A218452 Number of ways to factor (1 + x + x^2+ ... + x^(n - 1))^2 as the product of two monic polynomials of degree n - 1 with positive coefficients (counting order).
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 5, 7, 9, 9, 13, 11, 17, 19, 33
Offset: 1
Keywords
Examples
For n=12 we have a(n)=3 because apart from the obvious factorization of (1+x+...+x^11)^2 as (1+x+...+x^11) times itself, there exist the factorizations p*q and q*p where p = (1-sqrt(3)*x+x^2) * (1-x+x^2) * (1+x^2) * (1+x+x^2)^2 * (1+x) and q = (1-sqrt(3)*x+x^2) * (1-x+x^2) * (1+x^2) * (1+sqrt(3)*x+x^2)^2 * (1+x), both of which have positive coefficients, and those are the only two possible.
Programs
-
Sage
R.
= AA['x'] def has_positive_coefficients(pol): return not any(c <= 0 for c in pol.coeffs()) def trydie(m): results = [] tmp = list(factor(sum([x^i for i in range(m)]))) facs = [f for (f,_) in tmp] n = len(facs) for i in range((3^n+1)//2): exps = [(i//(3^k))%3 for k in range(n)] coexps = [2-v for v in exps] pol = R(prod([facs[k]^exps[k] for k in range(n)])) copol = R(prod([facs[k]^coexps[k] for k in range(n)])) if pol.degree()
Comments