OFFSET
1,1
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
prime(16)^16 mod 16 = 53^16 mod 16 = 3876269050118516845397872321 mod 16 = 1, therefore 16 is a term.
MAPLE
select(n -> ithprime(n) &^ n mod n = 1, [$1..1000]); # Robert Israel, Oct 31 2016
MATHEMATICA
Select[Range[1000], PowerMod[Prime[#], #, #] == 1&] (* Jean-François Alcover, Dec 16 2021 *)
PROG
(PARI) isok(k) = lift(Mod(prime(k), k)^k) == 1; \\ Michel Marcus, Dec 16 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Oct 31 2002
STATUS
approved