OFFSET
1,2
COMMENTS
For all 1 <= k <= n, add n if k is prime, otherwise add 1. For example, when n = 7, there are 4 primes less than or equal to 7 and 3 that are not. Then we have a(7) = 4*7 + 3 = 31.
FORMULA
a(n) = Sum_{k=1..n} n^c(k), where c(n) is the prime characteristic (A010051).
MATHEMATICA
Table[n + (n - 1)*PrimePi[n], {n, 50}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Jun 28 2021
STATUS
approved