A066602 a(n) = 4^n mod n.
0, 0, 1, 0, 4, 4, 4, 0, 1, 6, 4, 4, 4, 2, 4, 0, 4, 10, 4, 16, 1, 16, 4, 16, 24, 16, 1, 4, 4, 16, 4, 0, 31, 16, 9, 28, 4, 16, 25, 16, 4, 22, 4, 36, 19, 16, 4, 16, 18, 26, 13, 48, 4, 28, 34, 16, 7, 16, 4, 16, 4, 16, 1, 0, 49, 4, 4, 52, 64, 46, 4, 64, 4, 16, 49
Offset: 1
Examples
a(7) = 4 as 4^7 = 16384 = 7*2340 + 4.
Links
- Harry J. Smith, Table of n, a(n) for n = 1..1000
Programs
-
Maple
seq(irem(4^n,n),n=1..75); # Zerinvary Lajos, Apr 20 2008
-
Mathematica
Table[PowerMod[4, i, i], {i, 50}]
-
PARI
a(n) = { lift(Mod(4,n)^n) } \\ Harry J. Smith, Mar 09 2010
Extensions
More terms from Harvey P. Dale and Robert G. Wilson v, Dec 23 2001