OFFSET
1,2
FORMULA
a(n) = pi(n) + pi(n^2-1) - pi(n^2-n) + Sum_{k=1..n-2} (pi(n*k+1) - pi(n*k)).
EXAMPLE
[1 2 3 4 5]
[1 2 3 4] [6 7 8 9 10]
[1 2 3] [5 6 7 8] [11 12 13 14 15]
[1 2] [4 5 6] [9 10 11 12] [16 17 18 19 20]
[1] [3 4] [7 8 9] [13 14 15 16] [21 22 23 24 25]
------------------------------------------------------------------------
n 1 2 3 4 5
------------------------------------------------------------------------
a(n) 0 2 3 4 5
------------------------------------------------------------------------
primes {} {2,3} {2,3,7} {2,3,5,13} {2,3,5,11,23}
------------------------------------------------------------------------
MATHEMATICA
Table[PrimePi[n] + PrimePi[n^2 - 1] - PrimePi[n*(n - 1)] + Sum[PrimePi[n*k + 1] - PrimePi[n*k], {k, n - 2}], {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, May 14 2021
STATUS
approved