%I
%S 1,3,3,9,3,7,9,17,3,9,7,21,9,17,17,33,3,9,9,27,7,17,21,43,9,27,17,51,
%T 17,35,33,67,3,9,9,27,9,21,27,51,7,21,17,51,21,41,43,83,9,27,27,81,17,
%U 43,51,113,17,51,35,105,33,67,67,137,3,9,9,27,9,21,27,51,9,27,21,63,27,51
%N Number of odd coefficients in (1 + x + x^4)^n.
%H S. R. Finch, P. Sebah and Z.Q. Bai, <a href="http://arXiv.org/abs/0802.2654">Odd Entries in Pascal's Trinomial Triangle</a> (arXiv:0802.2654)
%e From _Omar E. Pol_, Mar 01 2015: (Start)
%e Written as an irregular triangle in which the row lengths are the terms of A011782, the sequence begins:
%e 1;
%e 3;
%e 3,9;
%e 3,7,9,17;
%e 3,9,7,21,9,17,17,33;
%e 3,9,9,27,7,17,21,43,9,27,17,51,17,35,33,67;
%e 3,9,9,27,9,21,27,51,7,21,17,51,21,41,43,83,9,27,27,81,17,43,51,113,17,51,35,105,33,67,67,137;
%e Thanks to _Michel Marcus_ we can see the first few terms of the next four rows as shown below:
%e 3,9,9,27,9,21,27,51,9,27,21,63,27,51,51,99,7,21,...
%e 3,9,9,27,9,21,27,51,9,27,21,63,27,51,51,99,9,27,27,...
%e 3,9,9,27,9,21,27,51,9,27,21,63,27,51,51,99,9,27,27,81,...
%e 3,9,9,27,9,21,27,51,9,27,21,63,27,51,51,99,9,27,27,81,21,...
%e ...
%e Apparently in each row the first quarter of the terms (and no more) are equal to 3 times the beginning of the sequence itself (comment corrected after Sloane's comment in A247649, Mar 03 2015).
%e (End)
%t Table[PolynomialMod[(1+x+x^4)^n,2]/.x>1,{n,0,80}]
%t Table[Count[CoefficientList[Expand[(1+x+x^4)^n],x],_?OddQ],{n,0,80}] (* _Harvey P. Dale_, Apr 15 2012 *)
%o (PARI) a(n) = {my(pol = (xx^4 + xx + 1)*Mod(1,2)); subst(lift(pol^n), xx, 1);} \\ _Michel Marcus_, Mar 01 2015
%o (PARI) tabf(nn, k=16) = {nbpt = 0; for (n=0, nn, if (n==0, nbt = 1, nbt = 2^(n1)); for (m=nbpt, nbpt+nbt1, if (mnbpt >k, k++; break); print1(nbopd(m), ",");); print(); nbpt += nbt;);} \\ _Michel Marcus_, Mar 03 2015
%Y Cf. A071053.
%K nonn
%O 0,2
%A _Steven Finch_, Jan 25 2008
%E First Mathematica program corrected by _Harvey P. Dale_, Apr 15 2012
