login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A143223 (Number of primes between n^2 and (n+1)^2) - (number of primes between n and 2n). 10
0, 2, 1, 1, 1, 1, 2, 1, 2, 0, 1, 1, 1, 2, 1, 2, 2, 1, 2, 2, 3, 2, 1, 1, 3, 2, 1, 1, 2, 2, 1, 3, 2, 3, 1, 2, 0, 0, 3, 2, 2, 2, -1, 3, 2, 3, 0, 4, 6, 0, 1, 4, 4, 1, 1, -2, -1, 3, -1, 3, 3, 1, 5, 3, 1, 3, 1, 2, 4, -1, 6, 1, 1, 4, 4, 4, 7, -1, 3, 8, -2, 5, 3, 5, 1, 0, 5, 5, 1, 2, 3, 2, 1, 5, 3, 3, 2, 3, 4, 1, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
Legendre's conjecture (still open) says there is always a prime between n^2 and (n+1)^2. Bertrand's postulate (actually a theorem due to Chebyshev) says there is always a prime between n and 2n.
Hashimoto's plot of (1 - a(n)) shows that |a(n)| is small compared to n for n < 30000.
From Jonathan Sondow, Aug 07 2008: (Start)
It appears that there are only a finite number of negative terms (see A143226).
If the negative terms are bounded, then Legendre's conjecture is true, at least for all sufficiently large n. This follows from the strong form of Bertrand's postulate proved by Ramanujan (see A104272 Ramanujan primes). (End)
REFERENCES
M. Aigner and C. M. Ziegler, Proofs from The Book, Chapter 2, Springer, NY, 2001.
G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 5th ed., Oxford Univ. Press, 1989, p. 19.
S. Ramanujan, Collected Papers of Srinivasa Ramanujan (G. H. Hardy, S. Aiyar, P. Venkatesvara and B. M. Wilson, eds.), Amer. Math. Soc., Providence, 2000, pp. 208-209.
LINKS
M. Hassani, Counting primes in the interval (n^2,(n+1)^2), arXiv:math/0607096 [math.NT], 2006.
S. Ramanujan, A proof of Bertrand's postulate, J. Indian Math. Soc., 11 (1919), 181-182.
J. Sondow and E. W. Weisstein, Bertrand's Postulate in MathWorld
FORMULA
a(n) = A014085(n) - A060715(n) (for n > 0) = [pi((n+1)^2) - pi(n^2)] - [pi(2n) - pi(n)] (for n > 1).
EXAMPLE
There are 4 primes between 6^2 and 7^2 and 2 primes between 6 and 2*6, so a(6) = 4 - 2 = 2.
a(1) = 2 because there are two primes between 1^2 and 2^2 (namely, 2 and 3) and none between 1 and 2. [Jonathan Sondow, Aug 07 2008]
MATHEMATICA
L={0, 2}; Do[L=Append[L, (PrimePi[(n+1)^2]-PrimePi[n^2]) - (PrimePi[2n]-PrimePi[n])], {n, 2, 100}]; L
PROG
(PARI) a(n)=sum(k=n^2+1, n^2+2*n, isprime(k))-sum(k=n+1, 2*n, isprime(k)) \\ Charles R Greathouse IV, May 30 2014
CROSSREFS
Negative terms are A143227. Cf. A104272 (Ramanujan primes).
Sequence in context: A080028 A309228 A309778 * A063993 A353445 A115722
KEYWORD
sign
AUTHOR
Jonathan Sondow, Jul 31 2008
EXTENSIONS
Corrected by Jonathan Sondow, Aug 07 2008, Aug 09 2008
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)