OFFSET
1,3
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
N:= 100: # for a(1)..a(N)
V:= Vector(N):
p:= 0:
do
p:= nextprime(p);
if p > N then break fi;
V[p]:= V[p]+1;
for k from 2 to floor(N/p) do
V[(k-1)*p+1 .. k*p]:= V[(k-1)*p+1 .. k*p] +~ k;
od;
if (k-1)*p+1<=N then V[(k-1)*p+1..N]:= V[(k-1)*p+1..N]+~ k fi
od:
convert(V, list); # Robert Israel, Jun 19 2019
PROG
(PARI) a(n) = sum(k=1, n, isprime(k)*ceil(n/k)); \\ Michel Marcus, Jun 19 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Apr 05 2004
STATUS
approved