A099774 Number of divisors of 2*n-1.
1, 2, 2, 2, 3, 2, 2, 4, 2, 2, 4, 2, 3, 4, 2, 2, 4, 4, 2, 4, 2, 2, 6, 2, 3, 4, 2, 4, 4, 2, 2, 6, 4, 2, 4, 2, 2, 6, 4, 2, 5, 2, 4, 4, 2, 4, 4, 4, 2, 6, 2, 2, 8, 2, 2, 4, 2, 4, 6, 4, 3, 4, 4, 2, 4, 2, 4, 8, 2, 2, 4, 4, 4, 6, 2, 2, 6, 4, 2, 4, 4, 2, 8, 2, 3, 6, 2, 6, 4, 2, 2, 4, 4, 4, 8, 2, 2, 8, 2, 2, 4, 4, 4, 6, 4
Offset: 1
Examples
a(5)=3 because the divisors of 9 are: 1, 3 and 9.
Links
- Seiichi Manyama, Table of n, a(n) for n = 1..10000
Programs
-
GAP
List([1..120],n->Tau(2*n-1)); # Muniru A Asiru, Dec 21 2018
-
Haskell
a099774 = a000005 . a005408 -- Reinhard Zumkeller, Sep 22 2014
-
Magma
[NumberOfDivisors(2*n+1): n in [0..100]]; // Vincenzo Librandi, Mar 18 2015
-
Maple
with(numtheory): seq(tau(2*n-1),n=1..120);
-
Mathematica
nn = 200; f[list_, i_] := list[[i]];a =Table[Boole[OddQ[n]], {n, 1, nn}];Select[Table[DirichletConvolve[f[a,n], f[a, n], n, m], {m, 1, nn}], # > 0 &] (* Geoffrey Critzer, Feb 15 2015 *) Table[DivisorSigma[0, 2*n-1], {n, 1, 100}] (* Vaclav Kotesovec, Jan 14 2019 *)
-
PARI
{a(n)=if(n<1, 0, numdiv(2*n-1))} /* Michael Somos, Sep 03 2006 */
Formula
G.f.: Sum_{k>0} x^k/(1-x^(2*k-1)). - Michael Somos, Sep 02 2006
G.f.: sum(k>=1, x^((2*k-1)^2/2+1/2) * (1+x^(2*k-1))/(1-x^(2*k-1)) ). - Joerg Arndt, Nov 08 2010
Dirichlet g.f. (with interpolated zeros): zeta(s)^2*(1-1/2^s)^2. - Geoffrey Critzer, Feb 15 2015
Sum_{k=1..n} a(k) ~ (n*log(n) + (2*gamma - 1 + 3*log(2))*n)/2, where gamma is Euler's constant (A001620). - Amiram Eldar, Nov 27 2022
Extensions
More terms from Emeric Deutsch, Dec 03 2004