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.

A014085 Number of primes between n^2 and (n+1)^2.

Original entry on oeis.org

0, 2, 2, 2, 3, 2, 4, 3, 4, 3, 5, 4, 5, 5, 4, 6, 7, 5, 6, 6, 7, 7, 7, 6, 9, 8, 7, 8, 9, 8, 8, 10, 9, 10, 9, 10, 9, 9, 12, 11, 12, 11, 9, 12, 11, 13, 10, 13, 15, 10, 11, 15, 16, 12, 13, 11, 12, 17, 13, 16, 16, 13, 17, 15, 14, 16, 15, 15, 17, 13, 21, 15, 15, 17, 17, 18, 22, 14, 18, 23, 13
Offset: 0

Views

Author

Jon Wild, Jul 14 1997

Keywords

Comments

Suggested by Legendre's conjecture (still open) that for n > 0 there is always a prime between n^2 and (n+1)^2.
a(n) is the number of occurrences of n in A000006. - Philippe Deléham, Dec 17 2003
See the additional references and links mentioned in A143227. - Jonathan Sondow, Aug 03 2008
Legendre's conjecture may be written pi((n+1)^2) - pi(n^2) > 0 for all positive n, where pi(n) = A000720(n), [the prime counting function]. - Jonathan Vos Post, Jul 30 2008 [Comment corrected by Jonathan Sondow, Aug 15 2008]
Legendre's conjecture can be generalized as follows: for all integers n > 0 and all real numbers k > K, there is a prime in the range n^k to (n+1)^k. The constant K is conjectured to be log(127)/log(16). See A143935. - T. D. Noe, Sep 05 2008
For n > 0: number of occurrences of n^2 in A145445. - Reinhard Zumkeller, Jul 25 2014

Examples

			a(17) = 5 because between 17^2 and 18^2, i.e., 289 and 324, there are 5 primes (which are 293, 307, 311, 313, 317).
		

References

  • J. R. Goldman, The Queen of Mathematics, 1998, p. 82.

Crossrefs

First differences of A038107.
Counts of primes between consecutive higher powers: A060199, A061235, A062517.

Programs

  • Haskell
    a014085 n = sum $ map a010051 [n^2..(n+1)^2]
    -- Reinhard Zumkeller, Mar 18 2012
    
  • Mathematica
    Table[PrimePi[(n + 1)^2] - PrimePi[n^2], {n, 0, 80}] (* Lei Zhou, Dec 01 2005 *)
    Differences[PrimePi[Range[0,90]^2]] (* Harvey P. Dale, Nov 25 2015 *)
  • PARI
    a(n)=primepi((n+1)^2)-primepi(n^2) \\ Charles R Greathouse IV, Jun 15 2011
    
  • Python
    from sympy import primepi
    def a(n): return primepi((n+1)**2) - primepi(n**2)
    print([a(n) for n in range(81)]) # Michael S. Branicky, Jul 05 2021

Formula

a(n) = A000720((n+1)^2) - A000720(n^2). - Jonathan Vos Post, Jul 30 2008
a(n) = Sum_{k = n^2..(n+1)^2} A010051(k). - Reinhard Zumkeller, Mar 18 2012
Conjecture: for all n>1, abs(a(n)-(n/log(n))) < sqrt(n). - Alain Rocchelli, Sep 20 2023
Up to n=10^6 there are no counterexamples to this conjecture. - Hugo Pfoertner, Dec 16 2024
Sorenson & Webster show that a(n) > 0 for all 0 < n < 7.05 * 10^13. - Charles R Greathouse IV, Jan 31 2025

A060199 Number of primes between n^3 and (n+1)^3.

Original entry on oeis.org

0, 4, 5, 9, 12, 17, 21, 29, 32, 39, 49, 52, 58, 73, 76, 88, 92, 109, 117, 125, 140, 151, 159, 176, 188, 199, 207, 233, 247, 254, 267, 284, 305, 320, 346, 338, 373, 385, 416, 418, 437, 458, 481, 504, 517, 551, 555, 583, 599, 636, 648, 678, 686, 733, 723, 753, 810
Offset: 0

Views

Author

Labos Elemer, Mar 19 2001

Keywords

Comments

Ingham showed that for n large enough and k=5/8, prime(n+1)-prime(n) = O(prime(n)^k). Ingham's result implies that there is a prime between sufficiently large consecutive cubes. Therefore a(n) is nonzero for n sufficiently large. Using the Riemann Hypothesis, Caldwell and Cheng prove there is a prime between all consecutive cubes. The question is undecided for squares. Many authors have reduced the value of k. The best value of k is 21/40, proved by Baker, Harman and Pintz in 2001. - corrected by Jonathan Sondow, May 19 2013
Conjecture: There are always more than 3 primes between two consecutive nonzero cubes. - Cino Hilliard, Jan 05 2003
Dudek (2014), correcting a claim of Cheng, shows that a(n) > 0 for n > exp(exp(33.217)) = 3.06144... * 10^115809481360808. - Charles R Greathouse IV, Jun 27 2014
Cully-Hugill shows the above for n > exp(exp(32.892)) = 6.92619... * 10^83675518094285. - Charles R Greathouse IV, Aug 02 2021
Mossinghoff, Trudgian, & Yang improve this to n > exp(exp(32.76)) = 3.62275 * 10^73328286790528. - Charles R Greathouse IV, Jul 31 2024

Examples

			n = 2: there are 5 primes between 8 and 27, 11,13,17,19,23.
n = 9, n+1 = 10: PrimePi(1000)-PrimePi(729) = 168-129 = a(9) = 39.
		

Crossrefs

First differences of A038098.

Programs

  • Magma
    [0] cat [#PrimesInInterval(n^3, (n+1)^3): n in [1..70]]; // Vincenzo Librandi, Feb 13 2016
    
  • Mathematica
    PrimePi[(#+1)^3]-PrimePi[#^3]&/@Range[0,60] (* Harvey P. Dale, Feb 08 2013 *)
    Last[#]-First[#]&/@Partition[PrimePi[Range[0,60]^3],2,1] (* Harvey P. Dale, Feb 02 2015 *)
  • PARI
    cubespr(n)= for(x=0,n, ct=0; for(y=x^3,(x+1)^3, if(isprime(y), ct++; )); if(ct>=0,print1(ct, ", ")))  \\ Cino Hilliard, Jan 05 2003
    
  • Python
    from sympy import primepi
    def a(n): return primepi((n+1)**3) - primepi(n**3)
    print([a(n) for n in range(57)]) # Michael S. Branicky, Jun 22 2021

Formula

Table[PrimePi[(j+1)^3]-PrimePi[j^3], {j, 1, 100}]

Extensions

Corrected and added more detail to the Ingham references. - T. D. Noe, Sep 23 2008
Combined two comments, correcting a bad error in the first comment. - T. D. Noe, Sep 27 2008
Edited by N. J. A. Sloane, Jan 17 2009 at the suggestion of R. J. Mathar

A062517 Number of primes between n^5 and (n+1)^5.

Original entry on oeis.org

0, 11, 42, 119, 273, 540, 954, 1573, 2456, 3624, 5181, 7177, 9666, 12797, 16514, 21098, 26454, 32836, 40134, 48760, 58508, 69714, 82277, 96723, 112702, 130639, 150488, 172617, 197039, 223915, 253318, 285540, 320450, 358839, 400159, 445011, 493504
Offset: 0

Views

Author

Labos Elemer, Jul 10 2001

Keywords

Examples

			a(1) = 11 the number of primes between 1 = 1^5 and 32 = 2^5.
		

Crossrefs

Programs

  • Mathematica
    Table[PrimePi[(w+1)^5]-PrimePi[w^5], {w, 0, 50}]
  • PARI
    a(n) = { primepi((n + 1)^5) - primepi((n)^5) } \\ Harry J. Smith, Aug 08 2009

Extensions

Edited for consistency by Peter Munn, Apr 30 2017
Showing 1-3 of 3 results.