OFFSET
0,1
FORMULA
For n>=1, a(n) = Sum_{k=1..p(n+1)} (floor(p(n+1)/k) - floor(p(n)/k)), where p(n) is the n-th prime.
EXAMPLE
The 9th prime is 23 and the 10th prime is 29. So a(9) = d(24) + d(25) + d(26) + d(27) + d(28) + d(29) = 8 + 3 + 4 + 4 + 6 + 2 = 27.
MAPLE
MATHEMATICA
nn=80; Join[{3}, With[{nds=Table[DivisorSigma[0, n], {n, Prime[nn+1]}]}, Table[ Total[Take[nds, {Prime[n]+1, Prime[n+1]}]], {n, nn}]]] (* Harvey P. Dale, May 07 2012 *)
PROG
(Python)
from sympy import divisor_count, prime
def A139140(n): return sum(divisor_count(k) for k in range(prime(n)+1, prime(n+1)+1)) if n else 3 # Chai Wah Wu, Oct 23 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Apr 10 2008
EXTENSIONS
More terms from R. J. Mathar, Apr 16 2008
STATUS
approved