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.

Previous Showing 21-30 of 114 results. Next

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

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 2, 2, 4, 2, 2, 3, 2, 4, 4, 1, 2, 3, 3, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 5, 5, 6, 4, 5, 7, 3, 6, 6, 8, 5, 5, 7, 4, 6, 7, 6, 7, 6, 6, 5, 9, 7, 7, 6, 7, 7, 6, 8, 8, 7, 7, 8, 9, 11, 7, 8, 10, 8, 11, 8, 7, 7, 10, 11, 12, 4, 9, 11, 6, 9, 9, 10, 8, 9, 8, 11, 8, 8, 9, 10, 8, 13, 10, 9, 10, 14, 12
Offset: 1

Views

Author

Cino Hilliard, Dec 30 2003

Keywords

Comments

For small values of n, these numbers exhibit higher and lower values as n increases. Conjectures: After n=17 a(n) > 1. There exists an n_1 such that a(n) is < a(n+1) for all n >= n_1.
Same as the number of primes between n^2 and n^2+n. Oppermann conjectured in 1882 that a(n)>0. - T. D. Noe, Sep 16 2008

References

  • Paulo Ribenboim, The New Book of Prime Number Records, 3rd ed., 1995, Springer, p. 248.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 183.

Crossrefs

Programs

  • Haskell
    a089610 n = sum $ map a010051' [n^2 .. n*(n+1)]
    -- Reinhard Zumkeller, Jun 07 2015
  • Mathematica
    a[n_] := PrimePi[(n + 1/2)^2] - PrimePi[n^2]; Table[ a@n, {n, 100}] (* Robert G. Wilson v, May 04 2009 *)
  • PARI
    a(n) = primepi(n^2+n) - primepi(n^2); \\ Michel Marcus, May 18 2020
    

A143223 (Number of primes between n^2 and (n+1)^2) - (number of primes between n and 2n).

Original entry on oeis.org

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
Offset: 0

Views

Author

Jonathan Sondow, Jul 31 2008

Keywords

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)

Examples

			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]
		

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.

Crossrefs

Negative terms are A143227. Cf. A104272 (Ramanujan primes).

Programs

  • Mathematica
    L={0,2}; Do[L=Append[L,(PrimePi[(n+1)^2]-PrimePi[n^2]) - (PrimePi[2n]-PrimePi[n])], {n,2,100}]; L
  • 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

Formula

a(n) = A014085(n) - A060715(n) (for n > 0) = [pi((n+1)^2) - pi(n^2)] - [pi(2n) - pi(n)] (for n > 1).

Extensions

Corrected by Jonathan Sondow, Aug 07 2008, Aug 09 2008

A143224 Numbers n such that (number of primes between n^2 and (n+1)^2) = (number of primes between n and 2n).

Original entry on oeis.org

0, 9, 36, 37, 46, 49, 85, 102, 107, 118, 122, 127, 129, 140, 157, 184, 194, 216, 228, 360, 365, 377, 378, 406, 416, 487, 511, 571, 609, 614, 672, 733, 767, 806, 813, 863, 869, 916, 923, 950, 978, 988, 1249, 1279, 1280, 1385, 1427, 1437, 1483, 1539, 1551, 1690
Offset: 1

Views

Author

Jonathan Sondow, Jul 31 2008

Keywords

Comments

The sequence gives the positions of zeros in A143223. The number of primes in question is A143225(n).
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.

Examples

			There is the same number of primes (namely 3) between 9^2 and 10^2 as between 9 and 2*9, so 9 is a term.
		

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. [Jonathan Sondow, Aug 03 2008]

Crossrefs

Programs

  • Maple
    with(numtheory): A143224:=n->`if`(pi((n+1)^2)-pi(n^2) = pi(2*n)-pi(n), n, NULL): seq(A143224(n), n=0..2000); # Wesley Ivan Hurt, Jul 25 2017
  • Mathematica
    L={}; Do[If[PrimePi[(n+1)^2]-PrimePi[n^2] == PrimePi[2n]-PrimePi[n], L=Append[L,n]], {n,0,2000}]; L
    (* Second program *)
    With[{nn = 2000}, {0}~Join~Position[#, {0}][[All, 1]] &@ Map[Differences, Transpose@ {Differences@ Array[PrimePi[#^2] &, nn], Array[PrimePi[2 #] - PrimePi[#] &, nn - 1]}]] (* Michael De Vlieger, Jul 25 2017 *)
  • PARI
    is(n) = primepi((n+1)^2)-primepi(n^2)==primepi(2*n)-primepi(n) \\ Felix Fröhlich, Jul 25 2017

Formula

A143223(a(n)) = 0.

A143225 Number of primes between n^2 and (n+1)^2, if equal to the number of primes between n and 2n.

Original entry on oeis.org

0, 3, 9, 9, 10, 10, 16, 20, 19, 21, 23, 23, 24, 25, 28, 31, 32, 36, 38, 56, 57, 59, 59, 62, 65, 71, 75, 84, 88, 88, 96, 102, 107, 115, 116, 119, 120, 126, 125, 129, 132, 132, 163, 168, 168, 182, 189, 189, 192, 197, 198, 213, 236
Offset: 1

Views

Author

Jonathan Sondow, Jul 31 2008

Keywords

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.
See the additional reference and link to Ramanujan's work mentioned in A143223. [Jonathan Sondow, Aug 03 2008]

Examples

			There are 3 primes between 9^2 and 10^2 and 3 primes between 9 and 2*9, so 3 is a member.
		

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.

Crossrefs

Programs

  • Mathematica
    L={}; Do[If[PrimePi[(n+1)^2]-PrimePi[n^2] == PrimePi[2n]-PrimePi[n], L=Append[L,PrimePi[2n]-PrimePi[n]]], {n,0,2000}]; L

Formula

a(n) = A014085(A143224(n)) = A060715(A143224(n)) for n > 0.

A143226 Numbers n such that there are more primes between n and 2n than between n^2 and (n+1)^2.

Original entry on oeis.org

42, 55, 56, 58, 69, 77, 80, 119, 136, 137, 143, 145, 149, 156, 174, 177, 178, 188, 219, 225, 232, 247, 253, 254, 257, 261, 263, 297, 306, 310, 325, 327, 331, 335, 339, 341, 344, 356, 379, 395, 402, 410, 418, 421, 425, 433, 451, 485, 500
Offset: 1

Views

Author

Jonathan Sondow, Jul 31 2008

Keywords

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.
It appears that this sequence is finite; searching up to 10^5, the last n appears to be 48717. [T. D. Noe, Aug 01 2008]
If the sequence is finite, then, by Bertrand's postulate, Legendre's conjecture is true for sufficiently large n. - Jonathan Sondow, Aug 02 2008
No other n <= 10^6. The plot of A143223 shows that it is quite likely that there are no additional terms. - T. D. Noe, Aug 04 2008
See the additional reference and link to Ramanujan's work mentioned in A143223. - Jonathan Sondow, Aug 03 2008

Examples

			There are 10 primes between 42 and 2*42, but only 9 primes between 42^2 and 43^2, so 42 is a member.
		

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.

Crossrefs

Programs

  • Mathematica
    L={}; Do[If[PrimePi[(n+1)^2]-PrimePi[n^2] < PrimePi[2n]-PrimePi[n], L=Append[L,n]], {n,0,500}]; L

Formula

A143223(n) < 0.

A143935 Number of primes between n^K and (n+1)^K, inclusive, where K=log(127)/log(16).

Original entry on oeis.org

2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 3, 2, 2, 5, 1, 4, 2, 3, 3, 4, 1, 5, 3, 3, 4, 3, 3, 3, 4, 4, 3, 5, 4, 3, 5, 2, 4, 5, 4, 5, 5, 3, 5, 5, 2, 6, 5, 4, 4, 4, 5, 5, 7, 5, 5, 3, 5, 6, 3, 8, 3, 4, 5, 6, 7, 5, 6, 8, 5, 4, 6, 6, 3, 7, 5, 4, 8, 5, 8, 6, 3, 7, 7, 6, 8, 7, 4, 5, 6, 5, 9, 9, 7, 6, 6, 6, 6, 7, 6, 4, 8, 5, 8, 8, 4
Offset: 1

Views

Author

T. D. Noe, Sep 05 2008

Keywords

Comments

This value of K is conjectured to be the least possible such that there is at least one prime in the range n^k and (n+1)^k for all n>0 and k>=K. This value of K was found using exact interval arithmetic. For each n <= 300 and for each prime p in the range n to n^2, we computed an interval k(n,p) such that p is between n^k(n,p) and (n+1)^k(n,p). The intersection of all these intervals produces a list of 29 intervals. The last interval appears to be semi-infinite beginning with K, which is log(127)/log(16). See A143898 for the smallest number in the first interval.
My UBASIC program indicates no prime between 113.457 ... and 126.999 .... Next prime > 113 is 127. I would like someone to check this. - Enoch Haga, Sep 24 2008
It suffices to check members of floor(A002386^(1/k)). - Charles R Greathouse IV, Feb 03 2011
The constant log(127)/log(16) is A194361. - John W. Nicholson, Dec 13 2013

Crossrefs

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

Programs

  • Mathematica
    k= 1.74717117169304146332; Table[Length[Select[Range[Ceiling[n^k],Floor[(n+1)^k]], PrimeQ]], {n,150}]
    With[{k=Log[16,127]},Table[Count[Range[Ceiling[n^k],Floor[(n+1)^k]],?PrimeQ],{n,110}]] (* _Harvey P. Dale, Apr 03 2019 *)

Extensions

Corrected a(15) from 1 to 0 Enoch Haga, Sep 24 2008
My intention was to include the endpoints of the range. Using k=log(127)/log(16), the endpoint for n=15 is exactly 127, which is prime. - T. D. Noe, Sep 25 2008

A061265 Number of squares between n-th prime and (n+1)st prime.

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1
Offset: 1

Views

Author

Amarnath Murthy, Apr 24 2001

Keywords

Comments

If n-th prime is a member of A053001 then a(n) is at least 1. If not, then a(n) = 0.
Legendre's conjecture (still open) that there is always a prime between n^2 and (n+1)^2 is equivalent to conjecturing that a(n) <= 1 for all n. - Vladeta Jovovic, May 01 2003
a(A038107(n)) = 1 for n > 1; a(A221056(n)) = 0. - Reinhard Zumkeller, Apr 15 2013

Examples

			a(3) = 0 as there is no square between 5, the third prime and 7, the fourth prime. a(4) = 1, as there is a square (9) between the 4th prime 7 and the 5th prime 11.
		

Crossrefs

Cf. A053001.
Cf. A038107.
Cf. A014085.

Programs

Formula

a(n) = floor(sqrt(prime(n+1))) - floor(sqrt(prime(n))). - Vladeta Jovovic, May 01 2003

Extensions

Extended by Patrick De Geest, Jun 05 2001
Offset changed from 0 to 1 by Harry J. Smith, Jul 20 2009

A111208 Number of primes <= n-th triangular number.

Original entry on oeis.org

0, 0, 2, 3, 4, 6, 8, 9, 11, 14, 16, 18, 21, 24, 27, 30, 32, 36, 39, 42, 46, 50, 54, 58, 62, 66, 70, 74, 79, 84, 90, 94, 99, 102, 108, 114, 121, 126, 131, 137, 141, 149, 154, 160, 166, 174, 180, 188, 193, 200, 205, 216, 220, 226, 235, 242, 250, 259, 267, 274, 281, 290
Offset: 0

Views

Author

Giovanni Teofilatto, Oct 25 2005

Keywords

Comments

Only because of the case n = 2 is it necessary to say "<=", otherwise "<" would suffice. Except for the first two terms, there are no consecutive identical terms for n < 10000. A065382 gives differences between consecutive terms of this sequence. - Alonso del Arte, Oct 31 2005

Crossrefs

Programs

  • Haskell
    a111208 n = length $ takeWhile (<= a000217 n) a000040_list
    -- Reinhard Zumkeller, Nov 01 2011
  • Mathematica
    Table[PrimePi[n*(n + 1)/2], {n, 0, 60}] (* Ray Chandler, Oct 31 2005 *)
  • PARI
    { allocatemem(932245000); default(primelimit, 4294965247); write("b111208.txt", 0, " ", 0); for (n = 1, 10000, t=n*(n + 1)/2; a=primepi(t); write("b111208.txt", n, " ", a); ) } \\ Harry J. Smith, Mar 10 2009
    
  • Sage
    [prime_pi(binomial(n,2)) for n in range(1, 63)] # Zerinvary Lajos, Jun 06 2009
    

Formula

a(n) = A000720(A000217(n)).

Extensions

Extended by Ray Chandler and Alonso del Arte, Oct 31 2005

A077766 Number of primes of form 4k+1 between n^2 and (n+1)^2.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 2, 1, 2, 3, 1, 2, 3, 1, 3, 4, 3, 3, 3, 4, 3, 2, 3, 5, 4, 3, 5, 4, 4, 4, 5, 4, 6, 5, 5, 4, 5, 4, 3, 7, 7, 3, 7, 5, 6, 5, 8, 8, 5, 4, 8, 9, 6, 5, 7, 7, 6, 8, 7, 8, 7, 6, 8, 7, 9, 8, 7, 7, 8, 9, 5, 10, 8, 7, 11, 9, 6, 10, 12, 8, 10, 10, 7, 8, 10, 12, 10, 11, 11, 9, 10, 10, 11, 10, 11, 11
Offset: 1

Views

Author

T. D. Noe, Nov 20 2002

Keywords

Comments

Related to Legendre's conjecture that there is always a prime between two consecutive squares.

Examples

			a(8)=1 because the prime 73 is between squares 64 and 81.
		

Crossrefs

Programs

  • Mathematica
    maxN=100; a=Table[0, {maxN}]; maxP=PrimePi[(maxN+1)^2]; For[i=1, i<=maxP, i++, p=Prime[i]; If[Mod[p, 4]==1, j=Floor[Sqrt[p]]; a[[j]]++ ]]; a

A094189 Number of primes between n^2-n and n^2 (inclusive).

Original entry on oeis.org

0, 2, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 3, 2, 2, 2, 3, 4, 4, 3, 4, 3, 3, 4, 5, 4, 3, 4, 5, 4, 4, 5, 4, 4, 5, 5, 2, 6, 6, 5, 4, 6, 4, 5, 7, 7, 3, 7, 8, 4, 5, 10, 7, 5, 6, 5, 5, 10, 7, 8, 8, 6, 10, 7, 5, 5, 8, 7, 7, 5, 10, 7, 8, 10, 7, 7, 10, 10, 9, 12, 7, 11, 10, 10, 9, 7, 13, 11, 10, 10, 11, 10, 11, 10, 11
Offset: 1

Views

Author

Jason Earls, May 25 2004

Keywords

Comments

Conjecture: for n>11, a(n)>1.
Oppermann conjectured in 1882 that a(n)>0 for n>1. - T. D. Noe, Sep 16 2008

References

  • Paulo Ribenboim, The New Book of Prime Number Records, 3rd ed., 1995, Springer, p. 248.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 183.

Crossrefs

Programs

  • Haskell
    a094189 n = sum $ map a010051' [n*(n-1) .. n^2]
    -- Reinhard Zumkeller, Jun 07 2015
  • Mathematica
    Table[PrimePi[n^2]-PrimePi[n^2-n-1],{n,100}] (* Harvey P. Dale, Jul 24 2015 *)
  • PARI
    a(n) = sum(k=n^2-n,n^2,isprime(k))
    
  • PARI
    a(n)=my(s);forprime(p=n^2-n,n^2,s++);s \\ Charles R Greathouse IV, Jan 18 2016
    
Previous Showing 21-30 of 114 results. Next