OFFSET
1,1
COMMENTS
Generalized sequence b(n) = Sum_{k=1..n} floor((n+k*t)/k) = t*n + Sum_{k=1..n} sigma_0(k), where sigma_0(k) is A000005(k). Also b(n) = t*n + A006218(n).
Partial sums of A334954. - Omar E. Pol, Sep 26 2020
FORMULA
a(n) = 2*n + Sum_{k=1..floor(n/2)} floor((n-k)/k). - Wesley Ivan Hurt, Dec 25 2020
PROG
(PARI) a(n) = n + sum(k=1, n, numdiv(k)); \\ Michel Marcus, Oct 02 2020
(Python)
from math import isqrt
def A156745(n): return n-(s:=isqrt(n))**2+(sum(n//k for k in range(1, s+1))<<1) # Chai Wah Wu, Oct 23 2023
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Ctibor O. Zizka, Feb 14 2009
EXTENSIONS
More terms from Eric M. Schmidt, Feb 28 2014
STATUS
approved