OFFSET
0,3
EXAMPLE
7, 111 in base 2, is transformed to the polynomial x^2+x+1. Composing this with itself (mod 2) gives (x^2+x+1)^2 + (x^2+x+1) + 1 = x^4+x+1, which transforms back to 19; so a(7) = 19.
PROG
(PARI) tox(n) = local(x=Mod(1, 2)*X, xp=1, r); while(n>0, if(n%2, r+=xp); xp*=x; n\=2); r
a(n) = local(p); p=tox(n); subst(lift(subst(p, X, p)), X, 2)
CROSSREFS
KEYWORD
nonn
AUTHOR
Franklin T. Adams-Watters, Jul 16 2011
STATUS
approved