OFFSET
1,2
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000
FORMULA
G.f. A(x) satisfies A(x) = x + (1/(1 - x)) * Sum_{k>=2} k * (1 - x^k) * A(x^k).
PROG
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
def A359399(n):
if n <= 1:
return 1
c, j = 0, 2
k1 = n//j
while k1 > 1:
j2 = n//k1 + 1
c += (j2*(j2-1)-j*(j-1)>>1)*A359399(k1)
j, k1 = j2, n//j2
return c+(n*(n+1)-(j-1)*j>>1) # Chai Wah Wu, Mar 31 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Mar 31 2023
STATUS
approved