OFFSET
0,7
LINKS
EXAMPLE
The triangle T(n, k) begins
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
0: 1
1: -1 0 1
2: 1 0 -2 0 -1 0 -2 0 1
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.g., row 2: {1,0,-2,0,-1,0,-2,0,1} corresponds to polynomial 1-2x^2-x^4-2x^6+x^8.
Number of terms in each row equals A002064(n).
PROG
(Python)
from itertools import product
def mult_pol(s1, s2):
res = [0]*(len(s1)+len(s2)-1)
for o1, i1 in enumerate(s1):
for o2, i2 in enumerate(s2):
res[o1+o2] += i1*i2
return res
out = []
for d in range(0, 5):
startp = [1, ]
for i in product((1, -1), repeat = d):
startp = mult_pol(startp, list(i)+[1, ])
out.extend(startp)
print(out)
(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
CROSSREFS
KEYWORD
sign,tabf
AUTHOR
Gleb Ivanov, May 22 2022
STATUS
approved