%I #23 Aug 24 2022 10:12:27
%S 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 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 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 Irregular triangle read by rows: coefficients of polynomials which are the product of all possible monic Littlewood polynomials of degree n.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Littlewood_polynomial">Littlewood polynomial</a>
%e The triangle T(n, k) begins
%e 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 0: 1
%e 1: -1 0 1
%e 2: 1 0 -2 0 -1 0 -2 0 1
%e 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 ...
%e 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 Number of terms in each row equals A002064(n).
%o (Python)
%o from itertools import product
%o def mult_pol(s1, s2):
%o res = [0]*(len(s1)+len(s2)-1)
%o for o1,i1 in enumerate(s1):
%o for o2,i2 in enumerate(s2):
%o res[o1+o2] += i1*i2
%o return res
%o out = []
%o for d in range(0, 5):
%o startp = [1,]
%o for i in product((1,-1),repeat = d):
%o startp = mult_pol(startp, list(i)+[1,])
%o out.extend(startp)
%o print(out)
%o (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 Cf. A020985, A002064 (row lengths).
%K sign,tabf
%O 0,7
%A _Gleb Ivanov_, May 22 2022