OFFSET
1,3
FORMULA
a(n) = (Sum_{k=1..n^2} k * c(k)) - (Sum_{k=1..n} (n^2-k+1) * c(n^2-k+1) + k * c(k)) - (Sum_{k=1..n-2} (n*k+1) * c(n*k+1)), where c(n) is the prime characteristic.
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 0 5 18 56
------------------------------------------------------------------------
MATHEMATICA
Table[Sum[i (PrimePi[i] - PrimePi[i - 1]), {i, n^2}] - Sum[(n^2 - k + 1) (PrimePi[n^2 - k + 1] - PrimePi[n^2 - k]) + k (PrimePi[k] - PrimePi[k - 1]), {k, n}] - Sum[(n*j + 1) (PrimePi[n*j + 1] - PrimePi[n*j]), {j, n - 2}], {n, 60}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, May 29 2021
STATUS
approved