OFFSET
0,2
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
FORMULA
MAPLE
r1:=proc(f) local g, n; g:=n->nops(expand(f^n) mod 2); [seq(g(n), n=0..90)]; end;
r1(1+x+x^2+x^4);
# Alternative:
P:= 1:
for n from 0 to 100 do
A[n]:= nops(P);
P:= expand(P*(1+x+x^2+x^4)) mod 2;
od:
seq(A[i], i=0..100); # Robert Israel, Jan 07 2018
MATHEMATICA
a[n_] := Count[(List @@ Expand[(1+x+x^2+x^4)^n]) /. x -> 1, _?OddQ]; a[0] = 1;
Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 06 2023 *)
PROG
(PARI) a(n) = {my(pol=(1+x+x^2+x^4)*Mod(1, 2)); subst(lift(pol^n), x, 1); } \\ Michel Marcus, Mar 01 2015
CROSSREFS
KEYWORD
nonn,look
AUTHOR
N. J. A. Sloane, Feb 28 2015
STATUS
approved