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)

A294508 Regular triangular array read by rows: T(n,m) = pi(n*m) - pi(n)*pi(m) for n > 0 and 0 < m <= n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Inspired by A291440.
Mincu and Panaitopol (2008) prove that pi(m*n) >= pi(m)*i(n) for all positive m and n except for m = 5, n = 7; m = 7, n = 5; and m = n = 7.
a(i) = -1 for i = 26 and 28, when n = 7 and m = either 5 or 7.
a(i) = 0 for i = 1, 6, 13, 15, 24, 33, 35, 81, 83, 85, 174, 176, 178; when n=m=1; n=m=3; n=5 and m is either 3 or 5; n=7 and m=3; n=8 and m is either 5 or 7; n=13 and m is either 3, 5, or 7; and n=19 with m being either 3, 5 or 7.
First occurrence of k = -1, 0, 1, 2, .., 20, 21, etc. occurs at i = 26, 1, 2, 4, 11, 22, 51, 45, 77, 54, 55, 76, 115, 120, 130, 187, 168, 135, 171, 136, 169, 274, etc.
Last occurrence of k >= -1 occurs at i = 28, 178, 260, 499, 906, 1179, 2704, 2778, 3406, 6558, 6673, 6789, 7024, 9594, 9733, 10156, 11479, 19704, 19903, 20304, 20709, 20913, etc.
Conjecture: min_{1<=m<=n} T(n,m) <= T(n,M) for all M > n if n <> 5.

Examples

			a(19) = 3 since 19 = 5*6/2 + 4, so the 19th term is T(6,4) = pi(6*4) - pi(6)*pi(4) = 9 - 3*2 = 3.
Triangular array begins:
   n\ m  1  2  3  4  5  6  7  8  9 10 11 12 13 14
   1  0
   2  1  1
   3  2  1  0
   4  2  2  1  2
   5  3  1  0  2  0
   6  3  2  1  3  1  2
   7  4  2  0  1 -1  1 -1
   8  4  2  1  3  0  3  0  2
   9  4  3  1  3  2  4  2  4  6
  10  4  4  2  4  3  5  3  6  8  9
  11  5  3  1  4  1  3  1  3  5  9  5
  12  5  4  1  5  2  5  3  4  8 10  7  9
  13  6  3  0  3  0  3  0  3  6  7  4  6  3
  14  6  3  1  4  1  5  1  5  6 10  6  9  6  8
  15  6  4  2  5  3  6  3  6  8 11  8 11  8 10 12
		

Crossrefs

Programs

  • Mathematica
    t[n_, m_] := PrimePi[n*m] - PrimePi[n]*PrimePi[m]; Table[ t[n, m], {n, 13}, {m, n}] // Flatten
  • PARI
    T(n,m) = primepi(n*m) - primepi(n)*primepi(m);
    tabl(nn) = for (n=1, nn, for (m=1, n, print1(T(n,m), ", ")); print); \\ Michel Marcus, Nov 08 2017

Formula

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