OFFSET
1,5
LINKS
FORMULA
a(n) = Sum_{i=1..floor((n-1)/2)} i * c(n - i), where c is the prime characteristic (A010051).
MAPLE
N:= 100: # for a(1) .. a(N)
V:= Vector(N):
for i from 1 do
p:= ithprime(i);
if p >= N then break fi;
m:= min(2*p-1, N);
V[p+1..m]:= V[p+1..m] + <$1..m-p>
od:
convert(V, list); # Robert Israel, Jan 26 2024
MATHEMATICA
Table[Sum[i (PrimePi[n - i] - PrimePi[n - i - 1]), {i, Floor[(n - 1)/2]}], {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Dec 09 2023
STATUS
approved