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.

A070316 Numbers n such that nextprime(n^2)-n^2 (n>=1) sets a new record.

Original entry on oeis.org

1, 3, 5, 11, 18, 23, 42, 63, 69, 102, 128, 143, 226, 254, 349, 370, 590, 757, 833, 873, 1110, 1165, 5018, 14908, 49495, 87598, 106359, 185179, 269697, 558269, 1070246, 1673629, 4292936, 43957056, 148793437, 982920306, 1569443693, 4556758439
Offset: 1

Views

Author

Donald S. McDonald, May 11 2002

Keywords

Examples

			nextprime(63^2) - 63^2 = 3989 - 3969 = 20, giving the terms 63 in the present sequence and 20 in A070317.
		

Crossrefs

Positions of record values in A053000 for n >= 1. Cf. A070317.

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; d = 0; Do[m = n; a = NextPrim[n^2] - n^2; If[a > d, d = a; Print[n]], {n, 1, 10^8}]
  • PARI
    A070316(n,show_all=0)={my(k=0,r=0);for(n=1,n,until(nextprime(k++^2)-k^2>r ,); r=nextprime(k^2)-k^2; show_all&print1(k","));k} \\ M. F. Hasler, Mar 23 2013

Extensions

Edited by N. J. A. Sloane and Robert G. Wilson v, May 11 2002
More terms from Ralf Stephan, Oct 14 2002
Further terms from Charles R Greathouse IV, Jun 16 2007
Typo in a(38) corrected by M. F. Hasler, Mar 23 2013