OFFSET
1,1
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..1000
EXAMPLE
a(2) = 48 because the numbers k are 4,5,6,7 and 8 (since 2^2 <= k < 3^2) and sigma(4) + sigma(5) + sigma(6) + sigma(7) + sigma(8) = 7 + 6 + 12 + 8 + 15 = 48, where sigma(n) is the sum of divisors of n (see A000203).
MATHEMATICA
A168012[n_]:=Sum[DivisorSigma[1, k], {k, n^2, (n+1)^2-1}];
Array[A168012, 50] (* Paolo Xausa, Oct 23 2023 *)
PROG
(PARI) a(n)=sum(k=n^2, (n+1)^2-1, sigma(k)) \\ Franklin T. Adams-Watters, May 14 2010
(Python)
def A168012(n):
a, b = n*(n+2), (n-1)*(n+1)
return (sum((q:=a//k)*((s:=k<<1)+q+1)-(r:=b//k)*(s+r+1) for k in range(1, n))>>1)+5*n+3 # Chai Wah Wu, Oct 23 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Omar E. Pol, Nov 16 2009
EXTENSIONS
More terms from Franklin T. Adams-Watters, May 14 2010
STATUS
approved