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.

A134662 Number of odd coefficients in (1 + x + x^4)^n.

Original entry on oeis.org

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, 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, 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
Offset: 0

Views

Author

Steven Finch, Jan 25 2008

Keywords

Examples

			From _Omar E. Pol_, Mar 01 2015: (Start)
Written as an irregular triangle in which the row lengths are the terms of A011782, the sequence begins:
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,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,43,51,113,17,51,35,105,33,67,67,137;
Thanks to _Michel Marcus_ we can see the first few terms of the next four rows as shown below:
3,9,9,27,9,21,27,51,9,27,21,63,27,51,51,99,7,21,...
3,9,9,27,9,21,27,51,9,27,21,63,27,51,51,99,9,27,27,...
3,9,9,27,9,21,27,51,9,27,21,63,27,51,51,99,9,27,27,81,...
3,9,9,27,9,21,27,51,9,27,21,63,27,51,51,99,9,27,27,81,21,...
...
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).
(End)
		

Crossrefs

Cf. A071053.

Programs

  • Mathematica
    Table[PolynomialMod[(1+x+x^4)^n,2]/.x->1,{n,0,80}]
    Table[Count[CoefficientList[Expand[(1+x+x^4)^n],x],?OddQ],{n,0,80}] (* _Harvey P. Dale, Apr 15 2012 *)
  • PARI
    a(n) = {my(pol = (xx^4 + xx + 1)*Mod(1,2)); subst(lift(pol^n), xx, 1);} \\ Michel Marcus, Mar 01 2015
    
  • PARI
    tabf(nn, k=16) = {nbpt = 0; for (n=0, nn, if (n==0, nbt = 1, nbt = 2^(n-1)); for (m=nbpt, nbpt+nbt-1, if (m-nbpt >k, k++; break); print1(nbopd(m), ",");); print(); nbpt += nbt;);} \\ Michel Marcus, Mar 03 2015

Extensions

First Mathematica program corrected by Harvey P. Dale, Apr 15 2012