OFFSET
0,2
LINKS
EXAMPLE
n=3, polynomial is x+1, f(x+1) = x^2+x+1, so a(3) = 111.
n=4, polynomial is x^2, f(x^2) = x, so a(4) = 10.
MAPLE
# Extract coefficient vector polynomial (decreasing powers):
coeflistD:=proc(f) local d, i, t1, t2, t3, t4;
if f=0 then RETURN([0]); else
d:=degree(f);
t1:=subs(x=1/x, f);
t2:=sort(expand(x^d*t1));
t3:=seriestolist(series(t2, x, d+2));
t4:=nops(t3);
if t4<d+1 then for i from t4+1 to d+1 do t3:=[op(t3), 0]; od: fi;
RETURN(t3);
fi;
end;
# Define map f:
f:=a->if subs(x=0, a) = 0 then expand(simplify(a/x)) mod 2;
else t1:=((x^2+1)*a+1)/x; expand(t1) mod 2; fi;
for n from 0 to 10000 do
t1:=convert(n, base, 2);
t2:=add(t1[i]*x^(i-1), i=1..nops(t1));
t3:=f(t2);
t4:=coeflistD(t3);
lprint(t4);
od:
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Feb 05 2011
STATUS
approved