# Finding absent partitions in polynomials using SageMath

The full details of the hybrid math/coding problem of interest to me are presented in the MathOverflow question "Outlier absences of monomials in a group of inversion partition polynomials". In order to develop code that would determine which monomials are absent in higher order polynomials, I need some pointers to Sage documentation/example code on

1) library calls to handle the relevant math

2) introducing an array for $K$ indeterminants $a_k$, or $a(k)$, of a polynomial $p(x) = 1 + \sum_{k = 1}^{K} a(k) * x^k/factorial(k)$

3) code for determining the absence of monomials/partitions of n in the partition polynomials RT_n derived through the transformations described in the MO-Q, of which the first few are illustrated in the MO-Q.

The crude SageMath code (my first) given in the MO-Q generates the first few partition polynomials, but identification of absent monomials was done by inspection of the results and comparison with other partition polynomials which contain the full panoply of partitions, e.g., the sets [E] and [P] given in the MO-Q.

Can someone direct me to relevant Sage documentation that would allow me to develop the code?

edit retag close merge delete

Sort by » oldest newest most voted

UPDATED. Here a function that computes missing partitions in RT polynomials (based on the code given in MO question):

def RT_poly(K):
A = PolynomialRing(QQ,K,'a')
a = A.gens()
P.<x> = PowerSeriesRing(A)

f = 1 / (1 + sum( ai * x^(i+1) / factorial(i+1) for i,ai in enumerate(a) )).add_bigoh(K+1)

g = integrate(f)
h = g.reverse()

return (1 / derivative(h,x))[K] * factorial(K)

def RT_missing(K):
return { tuple(p.to_exp(K)) for p in Partitions(K) } - set( RT_poly(K).exponents(False) )


For $K\leq 30$, RT_missing(K) produces non-empty sets only for $K\in \{ 7,8,13,14,23 \}$ - namely:

7 {(0, 1, 0, 0, 1, 0, 0)}
8 {(3, 1, 1, 0, 0, 0, 0, 0)}
13 {(0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0)}
14 {(0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0)}
23 {(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0)}

more

Perfect for Q#2. Thanks (not enough karma for upvoting). I suppose I could use the relevant calls for comparing character strings to find the missing monomials, so could you point me to a portion of some online doc that deals specifically with treating a polynomial as a character string and making comparisons between two such alpha-numeric strings (of course with the relevant loop and if-then statements)?

Assuming the monomials are always printed in the same basic order, I can strip off monomials from the polynomials of set [E], which lie between the first alphabetic character of a monomial and the following plus or minus sign, and look for the monomial in [RT].

1

Why do you want to work with them as strings? It's more natural to remain in the domain of polynomial coefficients - and you may get a more convenient representation of multinomial coefficients by converting them into a dict (where exponent vectors are mapped to the corresponding coefficients). For example, try this out: (f^2).dict() which will give you dict representation of the coefficient of $x^3$ (a polynomial in $a$'s) in $f^2$.

Max, same problems. First, the dict rep doesn't tell me that the monomial a1^3 for the partition 1+1+! = 3 has coefficient 0 (obviously) for the partition polynomial coefficient of x^3 of f^2, and since the number of partitions grow as OEIS A000041 = 1, 1, 2, 3, 5, 7, 11, 15, 22, 30, 42, 56, 77, 101, 135, 176, 231, 297, 385, 490, ..., visual inspection won't cut it. I still need to automate inspection of the dict rep to identify absent monomials, i.e., monomials with zero coefficients.

1

I do not quite follow your concern. For example, you can create a set of exponent vectors from partitions and a set of those present in a polynomial f as set(f.exponents(False)) and then compare these sets as needed (eg., compute set difference). UPD. I've added a complete code.