cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Aug 05 2002

Keywords

Comments

For n > 2, a(n) must be of the form 36k + 11. This is seen by induction since 36k + 11 + m^2 is even if m is odd and since 36k + 11 + (6m + 2)^2 and 36k + 11 + (6m + 4)^2 are both divisible by 3. - Gerald McGarvey, Jun 03 2007

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.
		

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