OFFSET
1,3
COMMENTS
a(n) = 0 iff n is a power of 2.
EXAMPLE
a(1) = 0 = 2 mod 1. a(2) = 0 = 2^3 mod 2. a(3) = 2 = 2^3^5 = 2^243 = 2 mod 3.
PROG
(PARI) { a(n, m=n, s=2) = local(g); if(s==prime(n), return(n%m)); g=s^valuation(m, s); m\=g; lift(chinese(Mod(0, g), Mod(s, m)^a(n, eulerphi(m), nextprime(s+1)) )) }
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Schorn, Mar 04 2021
STATUS
approved