OFFSET
1,1
COMMENTS
A straightforward approach to calculate a(n) would require computing tau (A000005) for the 2n+1 integers between n^2 and (n+1)^2. Since Sum_{i=1..n} tau(i) can be computed by summing sqrt(n) terms, we can compute a(n) via the summation of n terms of the form 2*(floor(n*(n+2)/i)-floor((n-1)*(n+1)/i)) without the need to compute tau. Similarly for the sequence A168012. - Chai Wah Wu, Oct 24 2023
LINKS
EXAMPLE
a(2) = 15 because the numbers k are 4, 5, 6, 7 and 8 (since 2^2 <= k < 3^2) and d(4) + d(5) + d(6) + d(7) + d(8) = 3 + 2 + 4 + 2 + 4 = 15, where d(n) is the number of divisors of n (see A000005).
MATHEMATICA
Table[Total[DivisorSigma[0, Range[n^2, (n+1)^2-1]]], {n, 60}] (* Harvey P. Dale, Aug 17 2015 *)
PROG
(PARI) a(n)=sum(k=n^2, (n+1)^2-1, numdiv(k)) \\ Franklin T. Adams-Watters, May 14 2010
(Python)
def A168010(n):
a, b = n*(n+2), (n-1)*(n+1)
return (sum(a//k-b//k for k in range(1, n))<<1)+5 # 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
