OFFSET
2,2
COMMENTS
a(n) = 0 iff n is a power of 2.
LINKS
Max Alekseyev, Table of n, a(n) for n = 2..1000
PROG
(PARI) { a(n, m=n, s=2) = local(g); if(s==n, return(n%m)); g=factor(gcd(s, m)); for(i=1, matsize(g)[1], g[i, 2]=valuation(m, g[i, 1]); m\=g[i, 1]^g[i, 2]); g=prod(i=1, matsize(g)[1], g[i, 1]^g[i, 2]); lift( chinese( Mod(0, g), Mod(s, m)^a(n, eulerphi(m), s+1) )) }
CROSSREFS
KEYWORD
nonn
AUTHOR
Max Alekseyev, Jun 02 2012
STATUS
approved