A073609 a(0) = 2; a(n) for n > 0 is the smallest prime greater than a(n-1) that differs from a(n-1) by a square.
2, 3, 7, 11, 47, 83, 227, 263, 587, 911, 947, 983, 1019, 1163, 1307, 1451, 1487, 1523, 1559, 2459, 3359, 4259, 4583, 5483, 5519, 5843, 5879, 6203, 6779, 7103, 7247, 7283, 7607, 7643, 8219, 8363, 10667, 11243, 11279, 11423, 12323, 12647, 12791, 13367
Offset: 0
Keywords
Examples
After 3, we skip over 5 because 5 - 3 = 2, which is not a square, but 7 - 3 = 4 = 2^2, so 7 follows 3 in the sequence. 11 is the next prime after 7 and it differs from 7 by 4, so 11 follows 7 in the sequence. 47 differs from 11 by 36 = 6^2 and no prime between 11 and 47 differs from 11 by a square, so 47 is the next term after 11.
Links
- Zak Seidov, Table of n, a(n) for n = 0..1000
Crossrefs
Cf. A217840.
Programs
-
Mathematica
p = 11; s2 = Join[{2, 3, 7, 11}, Table[x = 6; While[!PrimeQ[a = p + x^2], x = x + 6]; p = a, {99}]] (* Murthy *) nxt[n_] := Module[{np = NextPrime[n]}, While[!IntegerQ[Sqrt[np - n]], np = NextPrime[np]]; np]; NestList[nxt, 2, 50] (* Harvey P. Dale, Mar 13 2013 *)
-
PARI
print1(a=2,","); for(n=1,43,k=1; while(!isprime(b=a+k^2),k++); print1(a=b,","))
Extensions
Edited and extended by Klaus Brockhaus, Aug 07 2002
Comments