cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A354272 Irregular triangle read by rows: coefficients of polynomials which are the product of all possible monic Littlewood polynomials of degree n.

This page as a plain text file.
%I A354272 #23 Aug 24 2022 10:12:27
%S A354272 1,-1,0,1,1,0,-2,0,-1,0,-2,0,1,1,0,-4,0,2,0,-4,0,15,0,8,0,-36,0,8,0,
%T A354272 15,0,-4,0,2,0,-4,0,1,1,0,-8,0,20,0,-24,0,58,0,-80,0,-92,0,120,0,147,
%U A354272 0,384,0,-2108,0,880,0,3940,0,-3096,0,2288,0,-2136,0,-1803,0,-2136,0,2288,0,-3096,0,3940,0,880,0,-2108,0,384,0,147,0,120,0,-92,0,-80,0,58,0,-24,0,20,0,-8,0,1
%N A354272 Irregular triangle read by rows: coefficients of polynomials which are the product of all possible monic Littlewood polynomials of degree n.
%H A354272 Wikipedia, <a href="https://en.wikipedia.org/wiki/Littlewood_polynomial">Littlewood polynomial</a>
%e A354272 The triangle T(n, k) begins
%e A354272 n\k  1 2  3 4  5 6  7 8 9 10 11 12  13 14 15 16 17 18 19 20 21 22 23 24 25
%e A354272 0:   1
%e A354272 1:  -1 0  1
%e A354272 2:   1 0 -2 0 -1 0 -2 0 1
%e A354272 3:   1 0 -4 0  2 0 -4 0 15 0  8  0 -36  0  8  0 15  0 -4  0  2  0 -4  0  1
%e A354272 ...
%e A354272 E.g., row 2: {1,0,-2,0,-1,0,-2,0,1} corresponds to polynomial 1-2x^2-x^4-2x^6+x^8.
%e A354272 Number of terms in each row equals A002064(n).
%o A354272 (Python)
%o A354272 from itertools import product
%o A354272 def mult_pol(s1, s2):
%o A354272     res = [0]*(len(s1)+len(s2)-1)
%o A354272     for o1,i1 in enumerate(s1):
%o A354272         for o2,i2 in enumerate(s2):
%o A354272             res[o1+o2] += i1*i2
%o A354272     return res
%o A354272 out = []
%o A354272 for d in range(0, 5):
%o A354272     startp = [1,]
%o A354272     for i in product((1,-1),repeat = d):
%o A354272         startp = mult_pol(startp, list(i)+[1,])
%o A354272     out.extend(startp)
%o A354272 print(out)
%o A354272 (PARI) row(n) = { Vecrev(Vec(prod (k=2^n, 2^(n+1)-1, Pol(apply(d -> if (d, 1, -1), binary(k)))))) } \\ _Rémy Sigrist_, Jul 21 2022
%Y A354272 Cf. A020985, A002064 (row lengths).
%K A354272 sign,tabf
%O A354272 0,7
%A A354272 _Gleb Ivanov_, May 22 2022