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.

Showing 1-3 of 3 results.

A053000 a(n) = (smallest prime > n^2) - n^2.

Original entry on oeis.org

2, 1, 1, 2, 1, 4, 1, 4, 3, 2, 1, 6, 5, 4, 1, 2, 1, 4, 7, 6, 1, 2, 3, 12, 1, 6, 1, 4, 3, 12, 7, 6, 7, 2, 7, 4, 1, 4, 3, 2, 1, 12, 13, 12, 13, 2, 13, 4, 5, 10, 3, 8, 3, 10, 1, 12, 1, 2, 7, 10, 7, 6, 3, 20, 3, 4, 1, 4, 13, 22, 3, 10, 5, 4, 1, 14, 3, 10, 5, 6, 21, 2, 9, 10, 1, 4, 15, 4, 9, 6, 1, 6, 3, 14
Offset: 0

Views

Author

N. J. A. Sloane, Feb 21 2000

Keywords

Comments

Suggested by Legendre's conjecture (still open) that there is always a prime between n^2 and (n+1)^2.
Record values are listed in A070317, their indices in A070316. - M. F. Hasler, Mar 23 2013
Conjecture: a(n) <= 1+phi(n) = 1+A000010(n), for n>0. This improves on Oppermann's conjecture, which says a(n) < n. - Jianglin Luo, Sep 22 2023

References

  • J. R. Goldman, The Queen of Mathematics, 1998, p. 82.
  • R. K. Guy, Unsolved Problems in Number Theory, Section A1.

Crossrefs

Programs

  • Magma
    [NextPrime(n^2) - n^2: n in [0..100]]; // Vincenzo Librandi, Jul 06 2015
    
  • Maple
    A053000 := n->nextprime(n^2)-n^2;
  • Mathematica
    nxt[n_]:=Module[{n2=n^2},NextPrime[n2]-n2]
    nxt/@Range[0,100]  (* Harvey P. Dale, Dec 20 2010 *)
  • PARI
    A053000(n)=nextprime(n^2)-n^2  \\ M. F. Hasler, Mar 23 2013
    
  • Python
    from sympy import nextprime
    def a(n): nn = n*n; return nextprime(nn) - nn
    print([a(n) for n in range(94)]) # Michael S. Branicky, Feb 17 2022

Formula

a(n) = A013632(n^2). - Robert Israel, Jul 06 2015

Extensions

More terms from James Sellers, Feb 22 2000

A058055 a(n) is the smallest positive number m such that m^2 + n is the next prime > m^2.

Original entry on oeis.org

1, 3, 8, 5, 12, 11, 18, 51, 82, 49, 234, 23, 42, 75, 86, 231, 174, 107, 288, 63, 80, 69, 102, 325, 166, 765, 128, 143, 822, 727, 276, 597, 226, 835, 702, 461, 254, 693, 592, 797, 1284, 349, 370, 2337, 596, 645, 3012, 1033, 590, 4083, 1490, 757, 882, 833, 1668
Offset: 1

Views

Author

Labos Elemer, Nov 20 2000

Keywords

Comments

The primes are in A058056.

Examples

			n=6: a(6)=11 and 11^2+6 is 127, a prime; n=97: a(97) = 2144 and 2144^2+97 = 4596833, the least prime of the form m^2+97.
		

Crossrefs

See A085099, A215249 for other versions.

Programs

  • Maple
    for m from 1 to 10^5 do
       r:= nextprime(m^2)-m^2;
       if not assigned(R[r]) then R[r]:= m end if;
    end do:
    J:= map(op,{indices(R)}):
    N:= min({$1..J[-1]} minus J)-1:
    [seq(R[j],j=1..N)]; # Robert Israel, Aug 10 2012
  • Mathematica
    nn = 100; t = Table[0, {nn}]; found = 0; m = 0; While[found < nn, m++; k = NextPrime[m^2] - m^2; If[k <= nn && t[[k]] == 0, t[[k]] = m; found++]]; t (* T. D. Noe, Aug 10 2012 *)
  • Sage
    R = {}   # After Robert Israel's Maple script.
    for m in (1..2^12) :
        r = next_prime(m^2) - m^2
        if r not in R : R[r] = m
    L = sorted(R.keys())
    for i in (1..len(L)-1) :
        if L[i] != L[i-1]+1 : break
    [R[k] for k in (1..i)]  # Peter Luschny, Aug 11 2012

Formula

a(n) = Min{ m > 0 | m^2 + n is the next prime after m^2}.
A053000(a(n)) = n. - Zak Seidov, Apr 12 2013

Extensions

Definition corrected by Zak Seidov, Mar 03 2008, and again by Franklin T. Adams-Watters, Aug 10 2012

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
Showing 1-3 of 3 results.