A123993 Primes p such that p^2 is an interprime = average of two successive primes.
2, 3, 41, 907, 1151, 1553, 1609, 1667, 1801, 1907, 1933, 2351, 2473, 2531, 2953, 3001, 3571, 4007, 4073, 4253, 4663, 5023, 5417, 5881, 6143, 6257, 6329, 6343, 7879, 8461, 8521, 8563, 9041, 9067, 10103, 10781, 11243, 11251, 11257, 12097, 12413, 13217
Offset: 1
Keywords
Programs
-
Mathematica
Select[PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; Select[ Range[25000], 2#^2 == PrevPrim[ #^2] + NextPrim[ #^2] &],PrimeQ] atsp[n_]:=Module[{n2=n^2},(NextPrime[n2]+NextPrime[n2,-1])/2==n2]; Select[Prime[Range[2000]],atsp] (* Harvey P. Dale, Jan 05 2011 *)
-
PARI
isok(p) = isprime(p) && ((nextprime(p^2) + precprime(p^2)) / 2 - p^2 == 0); \\ Michel Marcus, Dec 11 2020
Comments