login
A213013
(2^3^4^5^...^n) mod n
3
0, 2, 0, 2, 2, 1, 0, 8, 2, 2, 8, 5, 8, 2, 0, 2, 8, 18, 12, 8, 2, 16, 8, 2, 18, 26, 8, 11, 2, 2, 0, 2, 2, 22, 8, 31, 18, 5, 32, 2, 8, 27, 24, 17, 16, 8, 32, 43, 2, 2, 44, 45, 26, 2, 8, 56, 40, 47, 32, 33, 2, 8, 0, 57, 2, 5, 36, 62, 22, 60, 8, 1, 68, 2, 56, 57, 44, 8, 32, 80, 2, 2, 8, 2
OFFSET
2,2
COMMENTS
a(n) = 0 iff n is a power of 2.
LINKS
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
A variant of A092188.
Sequence in context: A143751 A353322 A158950 * A242667 A059581 A344319
KEYWORD
nonn
AUTHOR
Max Alekseyev, Jun 02 2012
STATUS
approved