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-2 of 2 results.

A291440 a(n) = pi(n^2) - pi(n)^2, where pi(n) = A000720(n).

Original entry on oeis.org

0, 1, 0, 2, 0, 2, -1, 2, 6, 9, 5, 9, 3, 8, 12, 18, 12, 17, 8, 14, 21, 28, 18, 24, 33, 41, 48, 56, 46, 54, 41, 51, 60, 70, 79, 89, 75, 84, 96, 107, 94, 105, 87, 99, 110, 123, 104, 117, 132, 142, 153, 168, 153, 165, 178, 189, 201, 218, 198, 214, 195, 208, 225, 240, 254, 270, 248, 263, 280, 293, 275, 290, 264, 281, 298, 316, 338, 352, 327, 350
Offset: 1

Views

Author

Jonathan Sondow, Aug 23 2017

Keywords

Comments

The only zero values are a(1) = a(3) = a(5) = 0. The only negative value is a(7) = -1. In particular, pi(n^2) > pi(n)^2 for n > 7. These can be proved by the PNT with error term for large n and computation for smaller n.
For prime(n)^2 - prime(n^2), see A123914.
For pi(n^3) - pi(n)^3, see A291538.
Mincu and Panaitopol (2008) prove that pi(m*n) >= pi(m)*pi(n) for all positive m and n except for m = 5, n = 7; m = 7, n = 5; and m = n = 7. This implies for m = n that a(n) >= 0 if n <> 7. - Jonathan Sondow, Nov 03 2017
Diagonal of the triangular array A294508. - Jonathan Sondow and Robert G. Wilson v, Nov 08 2017

Examples

			a(7) = pi(7^2) - pi(7)^2 = 15 - 4^2 = -1.
		

Crossrefs

Programs

  • Magma
    [#PrimesUpTo(n^2)-#PrimesUpTo(n)^2: n in [1..80]]; // Vincenzo Librandi, Aug 26 2017
    
  • Maple
    seq(numtheory:-pi(n^2)-numtheory:-pi(n)^2, n=1..100); # Robert Israel, Aug 25 2017
  • Mathematica
    Table[PrimePi[n^2] - PrimePi[n]^2, {n, 80}]
  • PARI
    a(n) = primepi(n^2) - primepi(n)^2; \\ Michel Marcus, Sep 10 2017

Formula

a(n) = A000720(n^2) - A000720(n)^2.
a(n) ~ (n^2 / log(n))*(1/2 - 1/log(n)) as n tends to infinity, by the PNT.
From Jonathan Sondow and Robert G. Wilson v, Nov 08 2017: (Start)
a(n) = A294508(n*(n+1)/2).
a(n) >= A294509(n). (End)

A294509 a(n) is the least value of pi(n*m) - pi(n)*pi(m) for any positive m <= n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Least value in the n-th row of the table in A294508.
First occurrence of -1, 0, 1, 2, etc. occurs at n = 7, 1, 2, 10, 16, 27, 28, 36, 56, 58, 66, 88, 93, 94, 95, 125, 130, 145, 147, 148, 156, 190, 206, 207, 215, 216, 218, etc.
Last occurrence of -1, 0, 1, 2, etc. occurs at n = 7, 19, 23, 32, 43, 49, 74, 75, 83, 115, 116, 117, 119, 139, 140, 143, 152, 199, 200, 202, 204, 205, 213, 242, 244, 284, 285, etc.
Conjecture: a(n) <= pi(n*m) - pi(n)*pi(m) for all m > n if n <> 5.

Examples

			a(13) = 0 since 0 is the least value in the 13th row of A294508.
		

Crossrefs

Programs

  • Maple
    f:= n -> min(seq(numtheory:-pi(n*m)-numtheory:-pi(n)*numtheory:-pi(m), m=1..n)):
    map(f, [$1..200]); # Robert Israel, Nov 08 2017
  • Mathematica
    t[n_, m_] := PrimePi[n*m] - PrimePi[n]*PrimePi[m]; Min @@@ Table[ t[n, m], {n, 100}, {m, n}]
  • PARI
    a(n) = vecmin(vector(n, m, primepi(n*m) - primepi(n)*primepi(m))); \\ Michel Marcus, Nov 08 2017

Formula

a(n) = min_{1<=m<=n} A294508(n*(n-1)/2 + m).
a(n) <= A291440(n).
Showing 1-2 of 2 results.