OFFSET
1,5
FORMULA
G.f.: 1/(1-x) * Sum_{k>=1} x^(4*k)/(1-x^k) = 1/(1-x) * Sum_{k>=4} x^k/(1-x^k).
a(n) = A006218(n)-n-floor(n/2)-floor(n/3). - Chai Wah Wu, Oct 30 2023
PROG
(PARI) a(n) = sum(k=4, n, n\k);
(Python)
from math import isqrt
def A366972(n): return -(s:=isqrt(n))**2+(sum(n//k for k in range(4, s+1))<<1)+n+(n>>1)+n//3 if n>8 else (0, 0, 0, 0, 1, 2, 3, 4, 6)[n] # Chai Wah Wu, Oct 30 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Oct 30 2023
STATUS
approved