OFFSET
1,2
MATHEMATICA
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = 1; Do[ If[ Mod[p = NextPrim[p], n] == n - 2, Print[n]], {n, 1, 10^9}]
PROG
(PARI) for(i=1, 10^9, if(Mod(prime(i), i)==-2, print1(i, ", ")));
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Feb 18 2004
EXTENSIONS
Corrected by Mohammed Bouayoun (bouyao(AT)wanadoo.fr), Feb 20 2004
a(7)-a(12) from Robert G. Wilson v, Feb 22 2006
a(13)-a(19) from Giovanni Resta, Feb 23 2020
STATUS
approved