A050216 Number of primes between (prime(n))^2 and (prime(n+1))^2, with a(0) = 2 by convention.
2, 2, 5, 6, 15, 9, 22, 11, 27, 47, 16, 57, 44, 20, 46, 80, 78, 32, 90, 66, 30, 106, 75, 114, 163, 89, 42, 87, 42, 100, 354, 99, 165, 49, 299, 58, 182, 186, 128, 198, 195, 76, 356, 77, 144, 75, 463, 479, 168, 82, 166, 270, 90, 438, 275, 274, 292, 91, 292, 199, 99
Offset: 0
Examples
There are 2 primes less than 2^2, there are 2 primes between 2^2 and 3^2, 5 primes between 3^2 and 5^2, etc. [corrected by Jonathan Sperry, Aug 30 2013]
References
- Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 183.
Links
- T. D. Noe, Table of n, a(n) for n = 0..10000
- Joel E. Cohen, Conjectures about Primes and Cyclic Numbers, arXiv:2508.08335 [math.NT], 2025. See p. 16.
- Anthony G. Shannon and Jean V. Leyendekkers, On Legendre's Conjecture, Notes on Number Theory and Discrete Mathematics, Vol. 23, No. 2 (2017): 117-125.
- Nicolas Vaillant, Graph of A050216(n) / (n * A001223(n))
- Nicolas Vaillant, Average density of primes between prime(n)^2 and prime(n+1)^2
- Eric Weisstein's World of Mathematics, Brocard's Conjecture.
- Wikipedia, Brocard's Conjecture
Crossrefs
Programs
-
Haskell
import Data.List (group) a050216 n = a050216_list !! (n-1) a050216_list = map length $ filter (/= [0]) $ group $ map a010051 a000430_list -- Reinhard Zumkeller, Sep 23 2011
-
Maple
A050216 := proc(n) local p,pn ; if n = 0 then 2; else p := ithprime(n) ; pn := nextprime(p) ; numtheory[pi](pn^2)-numtheory[pi](p^2) ; end if; end proc: seq(A050216(n),n=0..40) ; # R. J. Mathar, Jan 27 2025
-
Mathematica
-Subtract @@@ Partition[PrimePi[Prime[Range[20]]^2], 2, 1] (* Eric W. Weisstein, Jan 10 2025 *)
-
PARI
a(n)={n||return(2);primepi(prime(n+1)^2)-primepi(prime(n)^2)} \\ M. F. Hasler, Dec 31 2014
Formula
Limit_{N->oo} (Sum_{n=1..N} a(n)) / (Sum_{n=1..N} prime(n)) = 1. - Alain Rocchelli, Sep 30 2023
Extensions
Edited by N. J. A. Sloane, Nov 15 2009
Comments