A139140 For n>=1, a(n) = d(prime(n)+1) + d(prime(n)+2) + d(prime(n)+3) + ... + d(prime(n+1)), where d(m) is the number of positive divisors of m and prime(n) is the n-th prime. a(0) = d(1) + d(2).
3, 2, 5, 6, 13, 8, 15, 8, 16, 27, 10, 29, 18, 10, 18, 31, 30, 14, 31, 20, 14, 30, 21, 34, 48, 23, 10, 22, 14, 24, 83, 22, 38, 10, 61, 14, 40, 36, 20, 41, 34, 20, 60, 16, 23, 14, 82, 72, 27, 14, 26, 36, 22, 58, 45, 36, 40, 18, 42, 28, 10, 67, 98, 26, 18, 24, 101, 42, 64, 14, 34
Offset: 0
Keywords
Examples
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.
Links
- John Tyler Rascoe, Table of n, a(n) for n = 0..10000
Crossrefs
Cf. A139141.
Programs
-
Maple
A000005 := proc(n) numtheory[tau](n) ; end: A006218 := proc(n) local k ; add(A000005(k),k=1..n) ; end: A139140 := proc(n) if n = 0 then RETURN(3) ; else A006218( ithprime(n+1))-A006218(ithprime(n)) ; fi ; end: seq(A139140(n),n=0..100) ; # R. J. Mathar, Apr 16 2008
-
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 *)
-
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
Formula
For n>=1, a(n) = Sum_{k=1..prime(n+1)} (floor(prime(n+1)/k) - floor(prime(n)/k)), where p(n) is the n-th prime.
Extensions
More terms from R. J. Mathar, Apr 16 2008