Ask Your Question

klaaa's profile - activity

2021-03-01 17:36:11 +0100 commented answer Finding isomorphic lists in a big list

Another question: Is there a command to obtain all the lists L_i in W up to equivalence (and their number up to equivale

2021-03-01 17:19:06 +0100 marked best answer Finding isomorphic lists in a big list

I have a big list W of lists L_i obtained in GAP that looks as follows for example:

[ [ [ 0, [ 6 ] ], [ 2, [ 0, 4 ] ], [ 2, [ 0, 4 ] ], [ 2, [ 0, 4 ] ], 
  [ 2, [ 0, 4 ] ], [ 2, [ 0, 0, 11 ] ] ], 
[ [ 0, [ 6 ] ], [ 2, [ 0, 3 ] ], [ 2, [ 0, 3 ] ], [ 2, [ 0, 3 ] ], 
  [ 2, [ 0, 0, 5 ] ], [ 1, [ 0, 1 ] ] ], 
[ [ 0, [ 6 ] ], [ 2, [ 0, 3 ] ], [ 2, [ 0, 3 ] ], [ 2, [ 0, 0, 2 ] ], 
  [ 1, [ 0, 4 ] ], [ 2, [ 0, 0, 3 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 3 ] ], [ 1, [ 0, 3 ] ], [ 2, [ 0, 1 ] ], 
  [ 2, [ 0, 1 ] ], [ 2, [ 0, 0, 3 ] ] ], 
[ [ 0, [ 6 ] ], [ 2, [ 0, 4 ] ], [ 1, [ 0, 2 ] ], [ 2, [ 0, 2 ] ], 
  [ 2, [ 0, 2 ] ], [ 2, [ 0, 0, 5 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 1 ] ], [ 2, [ 0, 3 ] ], [ 2, [ 0, 3 ] ], 
  [ 2, [ 0, 3 ] ], [ 2, [ 0, 0, 5 ] ] ], 
[ [ 0, [ 6 ] ], [ 2, [ 0, 4 ] ], [ 2, [ 0, 4 ] ], [ 2, [ 0, 3 ] ], 
  [ 2, [ 0, 1 ] ], [ 2, [ 0, 0, 7 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 2 ] ], [ 1, [ 0, 2 ] ], [ 1, [ 0, 3 ] ], 
  [ 2, [ 0, 0, 1 ] ], [ 2, [ 0, 0, 1 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 3 ] ], [ 1, [ 0, 2 ] ], [ 2, [ 0, 1 ] ], 
  [ 2, [ 0, 0, 2 ] ], [ 1, [ 0, 1 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 4 ] ], [ 1, [ 0, 2 ] ], [ 2, [ 0, 1 ] ], 
  [ 2, [ 0, 1 ] ], [ 2, [ 0, 0, 3 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 2 ] ], [ 1, [ 0, 2 ] ], [ 2, [ 0, 0, 1 ] ], 
  [ 1, [ 0, 1 ] ], [ 1, [ 0, 1 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 1 ] ], [ 1, [ 0, 2 ] ], [ 1, [ 0, 2 ] ], 
  [ 2, [ 0, 0, 1 ] ], [ 1, [ 0, 1 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 1 ] ], [ 1, [ 0, 1 ] ], [ 1, [ 0, 1 ] ], 
  [ 1, [ 0, 1 ] ], [ 1, [ 0, 1 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 1 ] ], [ 1, [ 0, 1 ] ], [ 1, [ 0, 2 ] ], 
  [ 1, [ 0, 2 ] ], [ 2, [ 0, 0, 1 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 1 ] ], [ 1, [ 0, 3 ] ], [ 1, [ 0, 2 ] ], 
  [ 2, [ 0, 1 ] ], [ 2, [ 0, 0, 2 ] ] ] ]

So an entry L_i of this list W is a list that looks for example as follows:

[ [ 0, [ 6 ] ], [ 1, [ 0, 1 ] ], [ 1, [ 0, 3 ] ], [ 1, [ 0, 2 ] ], 
  [ 2, [ 0, 1 ] ], [ 2, [ 0, 0, 2 ] ] ]

An element of this list L_i is again a list that looks like [ 1, [ 0, 3 ] ] for example.

Now two lists L_i and L_j are said to be isomorphic if they contain the same elements up to a permutation of entries.

My question is whether there is a quick method (the big list W might be alot bigger for larger examples) to check with Sage whether the big list W contains two isomorphic lists L_i and L_j?

edit: Using the suggestion of Max Alekseyev, here is the code how to do it with Sage in that example:

L=[ [ [ 0, [ 6 ] ], [ 2, [ 0, 4 ] ], [ 2, [ 0, 4 ] ], [ 2, [ 0, 4 ] ], 
[ 2, [ 0, 4 ] ], [ 2, [ 0, 0, 11 ] ] ], 
[ [ 0, [ 6 ] ], [ 2, [ 0, 3 ] ], [ 2, [ 0, 3 ] ], [ 2, [ 0, 3 ] ], 
[ 2, [ 0, 0, 5 ] ], [ 1, [ 0, 1 ] ] ], 
[ [ 0, [ 6 ] ], [ 2, [ 0, 3 ] ], [ 2, [ 0, 3 ] ], [ 2, [ 0, 0, 2 ] ], 
[ 1, [ 0, 4 ] ], [ 2, [ 0, 0, 3 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 3 ] ], [ 1, [ 0, 3 ] ], [ 2, [ 0, 1 ] ], 
[ 2, [ 0, 1 ] ], [ 2, [ 0, 0, 3 ] ] ], 
[ [ 0, [ 6 ] ], [ 2, [ 0, 4 ] ], [ 1, [ 0, 2 ] ], [ 2, [ 0, 2 ] ], 
[ 2, [ 0, 2 ] ], [ 2, [ 0, 0, 5 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 1 ] ], [ 2, [ 0, 3 ] ], [ 2, [ 0, 3 ] ], 
[ 2, [ 0, 3 ] ], [ 2, [ 0, 0, 5 ] ] ], 
[ [ 0, [ 6 ] ], [ 2, [ 0, 4 ] ], [ 2, [ 0, 4 ] ], [ 2, [ 0, 3 ] ], 
[ 2, [ 0, 1 ] ], [ 2, [ 0, 0, 7 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 2 ] ], [ 1, [ 0, 2 ] ], [ 1, [ 0, 3 ] ], 
[ 2, [ 0, 0, 1 ] ], [ 2, [ 0, 0, 1 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 3 ] ], [ 1, [ 0, 2 ] ], [ 2, [ 0, 1 ] ], 
[ 2, [ 0, 0, 2 ] ], [ 1, [ 0, 1 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 4 ] ], [ 1, [ 0, 2 ] ], [ 2, [ 0, 1 ] ], 
[ 2, [ 0, 1 ] ], [ 2, [ 0, 0, 3 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 2 ] ], [ 1, [ 0, 2 ] ], [ 2, [ 0, 0, 1 ] ], 
[ 1, [ 0, 1 ] ], [ 1, [ 0, 1 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 1 ] ], [ 1, [ 0, 2 ] ], [ 1, [ 0, 2 ] ], 
[ 2, [ 0, 0, 1 ] ], [ 1, [ 0, 1 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 1 ] ], [ 1, [ 0, 1 ] ], [ 1, [ 0, 1 ] ], 
[ 1, [ 0, 1 ] ], [ 1, [ 0, 1 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 1 ] ], [ 1, [ 0, 1 ] ], [ 1, [ 0, 2 ] ], 
[ 1, [ 0, 2 ] ], [ 2, [ 0, 0, 1 ] ] ], 
[ [ 0, [ 6 ] ], [ 1, [ 0, 1 ] ], [ 1, [ 0, 3 ] ], [ 1, [ 0, 2 ] ], 
[ 2, [ 0, 1 ] ], [ 2, [ 0, 0, 2 ] ] ] ]
n=len(L)
U=[]
for i in [0..n-1]: 
for j in [0..n-1]:
    U.append([[i,j],sorted(L[i])==sorted(L[j])])

display(U) display(L[1]) display(L[5])

2021-03-01 17:19:02 +0100 edited question Finding isomorphic lists in a big list

Finding isomorphic lists in a big list I have a big list W of lists L_i obtained in GAP that looks as follows for exampl

2021-03-01 17:16:05 +0100 commented answer Finding isomorphic lists in a big list

Thank you very much. I added in an edit to my answer how I made it with Sage using your suggestion.

2021-03-01 14:06:27 +0100 commented answer Finding isomorphic lists in a big list

Thank you, I will try that. But the lists L_i might have the same elements several times, so one should have equality of

2021-03-01 13:18:42 +0100 edited question Finding isomorphic lists in a big list

Finding isomorphic lists in a big list I have a big list W of lists L_i obtained in GAP that looks as follows for exampl

2021-03-01 13:17:03 +0100 asked a question Finding isomorphic lists in a big list

Finding isomorphic lists in a big list I have a big list W of lists L_i obtained in GAP that looks as follows for exampl

2021-02-10 18:25:12 +0100 received badge  Nice Question (source)
2021-02-09 17:08:27 +0100 commented answer Finding an involution with Sage

Thank you very much! It seems your code is not using the involution G (at least as an input). By property 3. F needs to have the property that restricted to the map LL1->LL2 it is equal to the involution G. Or do I have a thinking error? Also is there a way to obtain all F which have properties 1, 2 and 3 and count the number of such involutions? By the way, is there an easy method with sage to turn every bracket of the form ( into a bracket of the form [ in your output?

2021-02-09 17:05:45 +0100 received badge  Enthusiast
2021-02-08 11:13:39 +0100 asked a question Finding an involution with Sage

I have four lists L1,LL1 and L2, LL2 and a bijection G from LL1 to LL2. LL1 is a sublist of L1 and LL2 a sublist of L2. For example they look like this:

L1=[ [ [ 2, 2, 2, 1 ], 4 ], [ [ 3, 2, 2, 1 ], 3 ], [ [ 2, 3, 2, 1 ], 3 ], [ [ 3, 3, 2, 1 ], 3 ], [ [ 4, 3, 2, 1 ], 2 ] ]

LL1=[ [ [ 2, 2, 2, 1 ], 4 ], [ [ 3, 2, 2, 1 ], 3 ], [ [ 2, 3, 2, 1 ], 3 ], [ [ 4, 3, 2, 1 ], 2 ] ]

and

L2=[ [ [ 2, 2, 2, 1 ], 2 ], [ [ 3, 2, 2, 1 ], 3 ], [ [ 2, 3, 2, 1 ], 3 ], [ [ 3, 3, 2, 1 ], 3 ], [ [ 4, 3, 2, 1 ], 4 ] ]

LL2=[ [ [ 2, 2, 2, 1 ], 2 ], [ [ 3, 2, 2, 1 ], 3 ], [ [ 2, 3, 2, 1 ], 3 ], [ [ 4, 3, 2, 1 ], 4 ] ]

The bijection G looks like this:

[ [ [ [ 2, 2, 2, 1 ], 4 ], [ [ 4, 3, 2, 1 ], 4 ] ], [ [ [ 3, 2, 2, 1 ], 3 ], [ [ 2, 3, 2, 1 ], 3 ] ], [ [ [ 2, 3, 2, 1 ], 3 ], [ [ 3, 2, 2, 1 ], 3 ] ], 
[ [ [ 4, 3, 2, 1 ], 2 ], [ [ 2, 2, 2, 1 ], 2 ] ] ]

Thus an element in such a list is a tuple of the form [ [ 2, 2, 2, 1 ], 4 ] where [2,2,2,1] correponds to some algebraic object and the second entry is number. L1 and L2 will always have the same number of elements and LL1 and LL2 will have the same number of elements. The bijection G is given also as a list, where an entry such as

[ [ [ 2, 2, 2, 1 ], 4 ], [ [ 4, 3, 2, 1 ], 4 ] ]

means of course that G maps [ [ 2, 2, 2, 1 ], 4 ] to [ [ 4, 3, 2, 1 ], 4 ] .

Im searching for bijections F between L1 and L2 that satisfy the following three conditions:

  1. F is an involution, that is $F^2=id$.

  2. F preserves the number.

  3. F restricted to LL1 maps to LL2 via the given involution G.

In the above example F is uniquely given as follows:

[ [ [ [ 2, 2, 2, 1 ], 4 ], [ [ 4, 3, 2, 1 ], 4 ] ], [ [ [ 3, 2, 2, 1 ], 3 ], [ [ 2, 3, 2, 1 ], 3 ] ], [ [ [ 2, 3, 2, 1 ], 3 ], [ [ 3, 2, 2, 1 ], 3 ] ], 
[ [ [ 4, 3, 2, 1 ], 2 ], [ [ 2, 2, 2, 1 ], 2 ] ],[ [ [ 3, 3, 2, 1 ], 3 ], [ [ 3, 3, 2, 1 ], 3 ] ] ]

Here is another example where the lists are larger:

L1=[ [ [ 2, 2, 2, 2, 1 ], 5 ], [ [ 3, 2, 2, 2, 1 ], 4 ], [ [ 2, 3, 2, 2, 1 ], 3 ], [ [ 3, 3, 2, 2, 1 ], 4 ], [ [ 4, 3, 2, 2, 1 ], 3 ], 
[ [ 2, 2, 3, 2, 1 ], 4 ], [ [ 3, 2, 3, 2, 1 ], 3 ], [ [ 2, 3, 3, 2, 1 ], 4 ], [ [ 3, 3, 3, 2, 1 ], 4 ], [ [ 4, 3, 3, 2, 1 ], 3 ], [ [ 2, 4, 3, 2, 1 ], 3 ], [ 
[ 3, 4, 3, 2, 1 ], 3 ], 
[ [ 4, 4, 3, 2, 1 ], 3 ], [ [ 5, 4, 3, 2, 1 ], 2 ] ]

LL1=[ [ [ 2, 2, 2, 2, 1 ], 5 ], [ [ 3, 2, 2, 2, 1 ], 4 ], [ [ 2, 3, 2, 2, 1 ], 3 ], [ [ 4, 3, 2, 2, 1 ], 3 ], [ [ 2, 2, 3, 2, 1 ], 4 ], 
[ [ 3, 2, 3, 2, 1 ], 3 ], [ [ 2, 4, 3, 2, 1 ], 3 ], [ [ 5, 4, 3, 2, 1 ], 2 ] ]

L2=[ [ [ 2, 2, 2, 2, 1 ], 2 ], [ [ 3, 2, 2, 2, 1 ], 3 ], [ [ 2, 3, 2, 2, 1 ], 3 ], [ [ 3, 3, 2, 2, 1 ], 3 ], [ [ 4, 3, 2, 2, 1 ], 4 ], 
[ [ 2, 2, 3, 2, 1 ], 3 ], [ [ 3, 2, 3, 2, 1 ], 3 ], [ [ 2, 3, 3, 2, 1 ], 3 ], [ [ 3, 3, 3, 2, 1 ], 3 ], [ [ 4, 3, 3, 2, 1 ], 4 ], [ [ 2, 4, 3, 2, 1 ], 4 ], [ 
[ 3, 4, 3, 2, 1 ], 4 ], 
[ [ 4, 4, 3, 2, 1 ], 4 ], [ [ 5, 4, 3, 2, 1 ], 5 ] ]

LL2=[ [ [ 2, 2, 2, 2, 1 ], 2 ], [ [ 3, 2, 2, 2, 1 ], 3 ], [ [ 2, 3, 2, 2, 1 ], 3 ], [ [ 4, 3, 2, 2, 1 ], 4 ], [ [ 2, 2, 3, 2, 1 ], 3 ], 
[ [ 3, 2, 3, 2, 1 ], 3 ], [ [ 2, 4, 3, 2, 1 ], 4 ], [ [ 5, 4, 3, 2, 1 ], 5 ] ]


G=[ [ [ [ 2, 2, 2, 2, 1 ], 5 ], [ [ 5, 4, 3, 2, 1 ], 5 ] ], [ [ [ 3, 2, 2, 2, 1 ], 4 ], [ [ 2, 4, 3, 2, 1 ], 4 ] ], [ [ [ 2, 3, 2, 2, 1 ], 3 ], [ [ 3, 2, 3, 
2, 1 ], 3 ] ], 
[ [ [ 4, 3, 2, 2, 1 ], 3 ], [ [ 2, 2, 3, 2, 1 ], 3 ] ], [ [ [ 2, 2, 3, 2, 1 ], 4 ], [ [ 4, 3, 2, 2, 1 ], 4 ] ], [ [ [ 3, 2, 3, 2, 1 ], 3 ], [ [ 2, 3, 2, 2, 1 
], 3 ] ], 
[ [ [ 2, 4, 3, 2, 1 ], 3 ], [ [ 3, 2, 2, 2, 1 ], 3 ] ], [ [ [ 5, 4, 3, 2, 1 ], 2 ], [ [ 2, 2, 2, 2, 1 ], 2 ] ] ]

There might be many F satisfying the three conditions.

Thus my question: Is there an easy method to find all such bijections F satisfying the three conditions when L1,LL1,L2,LL2 and G are given?

2021-01-09 12:12:22 +0100 commented answer Translating quiver in QPA to Sage

Thank you very much again. I found the missing option using your suggestion, but sadly for large quivers the displayed directed graph looks terrible despite trying some options to fix that.

But this might be also a problem of tikz and Im not sure anymore whether Sage is the right thing to use for that. I therefore also posted the question in https://tex.stackexchange.com/questio... .

2021-01-08 22:07:14 +0100 commented answer Translating quiver in QPA to Sage

Thank you very much again! Is there a way to obtain the digraph as an object in sage so that one can obtain its latex code for example (and not just plot it)? For example like this one can obtain the latex code of the digraph without the edge labelings:

def from_QPA(Q):
arrows = [(v.SourceOfPath(), v.TargetOfPath(), v) for v in Q.ArrowsOfQuiver() ]
elements = Q.VerticesOfQuiver()
return DiGraph([elements, arrows], loops=True, format='vertices_and_edges')
libgap.LoadPackage("QPA")
Q = libgap.Quiver( ["v1","v2","v3"], [["v1","v2","a1"],["v2","v3","a2"],["v3","v1","a3"]] )
U=from_QPA(Q)
display(U)
display(latex(U))

Is there an easy way to obtain it with edge labelings?

2021-01-08 20:46:32 +0100 commented answer Translating quiver in QPA to Sage

Thank you very much! Here is how I entered it into the sage online cell:

data = ["v1","v2","v3","v4","v5","v6","v7","v8"], [["v1","v1","a"],["v1","v2","b"],["v2","v3","c"],["v3","v4","d"], 
["v4","v5","e"],["v5","v5","f"],
["v3","v6","g"],["v6","v7","h"],["v7","v8","i"],["v8","v3","j"]]          
U=DiGraph(data, format="vertices_and_edges",loops=True)                     
display(U)

This is very surprising that it works so easily. But there are two small problems:

  1. Loops are displayed very strange. (this is not a very big problem since loops appear rarely)

  2. The arrows have no names.

Is there an easy way to fix this?

2021-01-08 19:09:19 +0100 asked a question Translating quiver in QPA to Sage

QPA is a GAP-package that deals with quiver algebras. A quiver is just another word for directed graph. My question is whether there is a quick way to translate the QPA-output of a quiver into a directed graph (with the same names for vertices and arrows) for Sage. For example a quiver in QPA looks as follows:

Quiver( ["v1","v2","v3","v4","v5","v6","v7","v8"], [["v1","v1","a"],["v1","v2","b"],["v2","v3","c"],["v3","v4","d"],["v4","v5","e"],["v5","\v5","f"],["v3","v6","g"],["v6","v7","h"],["v7","v8","i"],["v8","v3","j"]] )

or as follows:

Quiver( ["v1","v2","v3"], [["v1","v2","a1"],["v2","v3","a2"],["v3","v1","a3"]] )

So the first list of the form ["v1","v2","v3","v4","v5","v6","v7","v8"] are always the names of the vertices and the second list

 [["v1","v1","a"],["v1","v2","b"],["v2","v3","c"],["v3","v4","d"],["v4","v5","e"],["v5","\v5","f"],["v3","v6","g"],["v6","v7","h"],["v7","v8","i"],["v8","v3","j"]]

are the names of the vertices, together with the information where they start and end. So for example ,["v2","v3","c"] means that the arrow c starts at v2 and ends at v3.

2020-12-28 18:13:29 +0100 commented answer Translating a GAP-output for Sage

Thank you very much for this detailed answer!

2020-12-28 00:33:04 +0100 asked a question Translating a GAP-output for Sage

I made the following code in GAP to generate all monic irreducible polynomials of degree n with coefficients 1,-1 or 0 and non-zero constant term:

n:=7;d:=n-1;x:=Indeterminate(Rationals,1);U:=Tuples([-1,1,0],n);UU:=Filtered(U,x->(x[1]=0)=false and x[n]=1);W:=[];for i in UU do Append(W,[UnivariatePolynomial(Rationals,i,1)]);od;WW:=Filtered(W,x->IsIrreducible(x)=true);WW;

Now I wanted to use the resulting list WW in Sage to do operations only Sage can do. But how do I get WW now in Sage? It seems very complicated and using https://sagecell.sagemath.org/ (where the language is set to "GAP") produces no output, while the output is displayed without any problems when I use a terminal for GAP.

Is there an easy solution for my problem? (other than programming it in Sage, which would also be interesting but it seems it is easier to deal with the generation of polynomials via GAP)

2020-12-27 19:11:04 +0100 asked a question Translating a list of polynomials using sage

I have a list of polynomials in Sage as follows:

n=5
W=[P.coxeter_polynomial() for P in posets(n)]

Now I want to have the list of all such polynomials as polynomials in R.<x> = PolynomialRing(ComplexField(100)) .

My question is: Is there an easy way to translate the above list W so that Sage views every polynomial in that list as a polynomial in R.<x> = PolynomialRing(ComplexField(100))?

2020-12-27 19:08:48 +0100 commented answer Finding absolute values of roots of polynomials with Sage

Thank you very much! Do you have a realistic expectation what to use to get a fast and correct result that is correct up to 7 decimals? For example is PolynomialRing(ComplexField(100)) good enough for that?

2020-12-27 18:45:01 +0100 commented answer Finding absolute values of roots of polynomials with Sage

Thank you but this is not very precise. For example:

R.<x> = CDF[]
P=x^7 + 7*x^6 + 21*x^5 + 35*x^4 + 35*x^3 + 21*x^2 + 7*x + 1
UU=P.roots()
display(UU)

this polynomial has only the zero -1 (it is equal to (x+1)^7). But the approximated zeros are too imprecise. Is there a better way to get zeros that are correct at least until the 5. or 6. decimal place?

2020-12-26 23:43:31 +0100 received badge  Famous Question (source)
2020-12-26 23:43:31 +0100 received badge  Notable Question (source)
2020-12-26 20:20:00 +0100 asked a question Finding absolute values of roots of polynomials with Sage

Given a monic integer polynomial $p(x)$ in one variable $x$. Is it possible using Sage to obtain all absolute values of the roots of $p(x)$ in a list?

(Or at least all absolute values of roots that have absolute value (say) at most 2, if there general case is not possible and one needs a (small) bound.)

In my work there appear polynomials with large degree up to 40-50 so Im not sure whether such a thing is quickly possible for nowadays computers. But a solution would also be interesting even when it works only for degrees up to 20 or so.

The solution should give the correct answer for the absolute value of the roots for 5 or 6 decimal places.

2020-12-26 20:17:04 +0100 commented answer Finding certain partitions using Sage

Thank you very much. Sorry, there was a mistake in my formula. In the sum there is an n and not a k.

2020-12-16 13:29:35 +0100 received badge  Popular Question (source)
2020-12-11 18:27:56 +0100 edited question Finding certain partitions using Sage

Context

A partition of is a nonempty list $p = [p_1, p_2, ..., p_n]$ of positive integers (called the parts), of length $n \ge 1$.

The list is considered sorted in nondecreasing order: $p_1 \le p_2 \le ... \le p_n$.

Consider an integer $d \ge 1$. The partition $p$ is called $d$-admissible if each part $p_i$ is at least $2$ and inverses of the parts sum to $n - d - 1$.

In formulas: $2 \le p_1$ and $n - d - 1 = \sum \limits_{i=1}^{n} {\frac{1}{p_i}}$.

Question

Is there a quick way to filter all partitions using Sage to find all $d$-admissible partitions for a fixed $d \ge 1$?

Note that the assumptions imply $n \le 2(d+1)$ but the individual terms $p_i$ might get quite large (for $d=2$ the largest is already 42), which makes it very complicated to obtain a program that is quick and works for large $d$.

For example for $d=1$ there are four 1-admissible partitions, namely: [2,2,2,2], [3,3,3] ,[2,4,4] and [2,3,6]. For $d=2$ there are eighteen 2-admissible partitions.