OFFSET
0,6
COMMENTS
Row sums are:
{1, 2, 8, 32, 50, 128, 200, 242, 392, 512, 648,...}.
FORMULA
p(x,n)=Sum[x^i, {i, 0, (Prime[n] - 1)/2.2}];
q(n,n)=Sum[(-1)^i*x^i, {i, 0, (Prime[n] - 1)/2,2}];
t(x,n)=If[n == 0, 1, If[n == 1, x + 1, (x + 1)*p[x, n]*q[x, n]]];
out_(n,m)=coefficients(t(x,n)).
EXAMPLE
{1},
{1, 1},
{1, 1, 2, 2, 1, 1},
{1, 1, 2, 2, 3, 3, 4, 4, 3, 3, 2, 2, 1, 1},
{1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1},
{1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1}
MATHEMATICA
Clear[p, q, t, x, n];
p[x_, n_] := Sum[x^i, {i, 0, (Prime[n] - 1)/2, 2}];
q[x_, n_] := Sum[(-1)^i*x^i, {i, 0, (Prime[n] - 1)/2, 2}];
t[x_, n_] := If[n == 0, 1, If[n == 1, x + 1, (x + 1)*p[x, n]*q[x, n]]];
Table[ExpandAll[t[x, n]], {n, 0, 10, 2}];
Table[CoefficientList[ExpandAll[t[x, n]], x], {n, 0, 10, 2}];
Flatten[%]
CROSSREFS
KEYWORD
AUTHOR
Roger L. Bagula, Mar 08 2009
STATUS
approved