OFFSET
1,4
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
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Gabriel Mincu and Laurentiu Panaitopol, Properties of some functions connected to prime numbers, J. Inequal. Pure Appl. Math., 9 No. 1 (2008), Art. 12.
FORMULA
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)
EXAMPLE
a(7) = pi(7^2) - pi(7)^2 = 15 - 4^2 = -1.
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}]
PROG
(Magma) [#PrimesUpTo(n^2)-#PrimesUpTo(n)^2: n in [1..80]]; // Vincenzo Librandi, Aug 26 2017
(PARI) a(n) = primepi(n^2) - primepi(n)^2; \\ Michel Marcus, Sep 10 2017
CROSSREFS
KEYWORD
sign
AUTHOR
Jonathan Sondow, Aug 23 2017
STATUS
approved