login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = 4^n mod n.
8

%I #15 Dec 06 2024 21:44:52

%S 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,

%T 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,

%U 7,16,4,16,4,16,1,0,49,4,4,52,64,46,4,64,4,16,49

%N a(n) = 4^n mod n.

%H Harry J. Smith, <a href="/A066602/b066602.txt">Table of n, a(n) for n = 1..1000</a>

%e a(7) = 4 as 4^7 = 16384 = 7*2340 + 4.

%p seq(irem(4^n,n),n=1..75); # _Zerinvary Lajos_, Apr 20 2008

%t Table[PowerMod[4, i, i], {i, 50}]

%o (PARI) a(n) = { lift(Mod(4,n)^n) } \\ _Harry J. Smith_, Mar 09 2010

%K base,easy,nonn

%O 1,5

%A _Amarnath Murthy_, Dec 22 2001

%E More terms from _Harvey P. Dale_ and _Robert G. Wilson v_, Dec 23 2001