OFFSET
1,1
FORMULA
Sum_{k=1..n} a(floor(n/k)) = prime(n).
MATHEMATICA
Table[Sum[MoebiusMu[k] Prime[Floor[n/k]], {k, 1, n}], {n, 1, 74}]
g[1] = 2; g[n_] := Prime[n] - Prime[n - 1]; a[n_] := Sum[Sum[MoebiusMu[k/d] g[d], {d, Divisors[k]}], {k, 1, n}]; Table[a[n], {n, 1, 74}]
PROG
(PARI) a(n) = sum(k=1, n, moebius(k)*prime(n\k)); \\ Michel Marcus, Mar 22 2020
(Python)
from functools import lru_cache
from sympy import prime
@lru_cache(maxsize=None)
def A333450(n):
c, j = 2*(n+1)-prime(n), 2
k1 = n//j
while k1 > 1:
j2 = n//k1 + 1
c += (j2-j)*A333450(k1)
j, k1 = j2, n//j2
return 2*j-c # Chai Wah Wu, Mar 31 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Mar 21 2020
STATUS
approved