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-4 of 4 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

A085099 Least natural number k such that k^2 + n is prime.

Original entry on oeis.org

1, 1, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 4, 1, 6, 7, 2, 9, 2, 1, 12, 1, 4, 3, 2, 3, 6, 1, 2, 3, 2, 1, 24, 1, 2, 3, 4, 1, 6, 5, 2, 3, 4, 1, 6, 5, 2, 9, 2, 1, 18, 1, 6, 3, 2, 3, 6, 1, 2, 9, 2, 1, 6, 1, 4, 3, 2, 5, 6, 1, 2, 3, 4, 1, 12, 5, 2
Offset: 1

Views

Author

Jason Earls, Aug 10 2003

Keywords

Comments

First values of k and n such that k > 100 are: k=114, n=6041; for k > 200: k=210, n=26171; for k > 300: k=357, n=218084; for k > 400: k=402, n=576239.
Additionally, for k > 500: k=585, n=3569114; for k > 600: k=630, n=3802301; for k > 700: k=744, n=24307841; for k > 800: k=855, n=25051934; for k > 900: k=1008, n=54168539. Other cases k > 900: k=945, n=74380946, k=915, n=89992964, k=939, n=118991066. - Zak Seidov, May 23 2007
It is easily proved that for n > 2, a(n) >= A089128(n+1). The first inequality is a(21) = 4. - Franklin T. Adams-Watters, May 16 2018

Crossrefs

Programs

  • Maple
    a:= proc(n) local d, t; d, t:= 1, n+1; while not
          isprime(t) do d:= d+2; t:= t+d od; (d+1)/2
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 04 2019
  • Mathematica
    Table[i = 1; While[! PrimeQ[i^2 + n], i++]; i, {n, 85}] (* Jayanta Basu, Apr 24 2013 *)
  • PARI
    a(n)=my(k); while(!isprime(k++^2+n),); k \\ Charles R Greathouse IV, Jul 17 2016

Formula

a(n) = sqrt(A059843(n) - n). - Zak Seidov, Nov 24 2011

A058056 a(n) = p is the smallest prime such that p = n + h(n)^2 and p is the first prime following h(n)^2. The smallest immediate post-square primes with distance n = p - h(n)^2.

Original entry on oeis.org

2, 11, 67, 29, 149, 127, 331, 2609, 6733, 2411, 54767, 541, 1777, 5639, 7411, 53377, 30293, 11467, 82963, 3989, 6421, 4783, 10427, 105649, 27581, 585251, 16411, 20477, 675713, 528559, 76207, 356441, 51109, 697259, 492839, 212557, 64553, 480287, 350503, 635249
Offset: 1

Views

Author

Labos Elemer, Nov 20 2000

Keywords

Comments

The primes generated by the numbers in A058055.

Examples

			For n=5, a(5) = 149 = 5+144 = 5+12^2; although 41 = 5+36 = 5+k^2 but between 41 and 36 further prime occurs 37 while no more primes are between 144 and 149. n=7 a(7) = 331 = 324+7 = 18*18+7 and 331 = nextprime(324); numerous smaller primes (like {7, 11, 23, 43, 71, 107, 151, 263} = 7 + {0, 4, 16, 36, 64, 100, 144, 256}) have q = 7+k^2 form so that q is not the nextprime(7+k^2), 324 is the smallest square of this kind.
		

Programs

  • 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^2 + k; found++]]; t (* T. D. Noe, Aug 12 2012 *)

A215249 a(n) is the smallest number m >= n such that m^2 + n is a prime.

Original entry on oeis.org

1, 3, 4, 5, 6, 11, 8, 9, 10, 11, 24, 13, 16, 15, 16, 21, 24, 19, 20, 21, 40, 25, 24, 35, 26, 69, 28, 33, 30, 31, 34, 39, 56, 35, 48, 49, 38, 39, 50, 41, 54, 47, 44, 45, 46, 49, 48, 53, 50, 57, 56, 53, 54, 55, 56, 69, 64, 59, 60, 67, 64, 105, 64, 65, 66, 71, 68, 75
Offset: 1

Views

Author

N. J. A. Sloane, Aug 10 2012

Keywords

Crossrefs

Programs

  • Mathematica
    Table[m = n; While[! PrimeQ[m^2 + n], m++]; m, {n, 100}] (* T. D. Noe, Aug 12 2012 *)
Showing 1-4 of 4 results.