A291440 a(n) = pi(n^2) - pi(n)^2, where pi(n) = A000720(n).
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
Keywords
Examples
a(7) = pi(7^2) - pi(7)^2 = 15 - 4^2 = -1.
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.
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) ~ (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)
Comments