OFFSET
2,1
COMMENTS
All primes certified using PRIMO.
EXAMPLE
(3^3-1)/2=26/2=13 prime so for P(2) a(2)=3.
MATHEMATICA
a = {}; Do[ p1 = Prime[n]; k = 2; While[p2 = Prime[k]; ! PrimeQ[(p2^p1 - 1)/(p2 - 1)], k++ ]; AppendTo[a, p2]; , {n, 2, 62}]; a (* Ray Chandler, Jan 27 2005 *)
f[n_] := Block[{P = Prime[n], k = 2}, While[p = Prime[k]; !PrimeQ[(p^P - 1)/(p - 1)], k++ ]; Prime[ k]]; Table[ f[n], {n, 2, 62}] (* Robert G. Wilson v, Jan 27 2005 *)
PROG
(PARI) a(n) = my(p=3, q=prime(n)); while (!ispseudoprime((p^q-1)/(p-1)), p=nextprime(p+1)); p; \\ Michel Marcus, Mar 21 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jan 26 2005
EXTENSIONS
Extended by Ray Chandler and Robert G. Wilson v, Jan 27 2005
STATUS
approved