OFFSET
2,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 2..1000
EXAMPLE
n=5: 2^5=32=5*6+2, 3^5=243=5*48+3, 5^5 mod 5 = 0, 7^5=16807=5*3361+2, 11^5=161051=5*32210+1: a(5)=11.
MATHEMATICA
With[{prs=Prime[Range[200]]}, Table[SelectFirst[prs, PowerMod[#, n, n]==1&], {n, 2, 80}]] (* The program uses the SelectFirst function from Mathematica version 10 *) (* Harvey P. Dale, Aug 31 2015 *)
PROG
(PARI) a(n) = my(p=2); while (Mod(p, n)^n !=1, p=nextprime(p+1)); p; \\ Michel Marcus, Feb 07 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Aug 05 2004
STATUS
approved