OFFSET
1,2
LINKS
Jens Kruse Andersen, Table of n, a(n) for n = 1..10000
Omar E. Pol, Comments on A245579.
FORMULA
a(n) is multiplicative with a(2^e) = 2^e, a(p^e) = p^e * (e+1) if p>2.
a(n) = n * A001227(n).
G.f.: Sum_{k>0 odd} k * x^k / (1 - x^k)^2.
From Amiram Eldar, Dec 31 2022: (Start)
Dirichlet g.f.: zeta(s-1)^2*(1-1/2^(s-1)).
Sum_{k=1..n} a(k) ~ n^2*log(n)/4 + (4*gamma + 2*log(2) - 1)*n^2/8, where gamma is Euler's constant (A001620). (End)
EXAMPLE
G.f. = x + 2*x^2 + 6*x^3 + 4*x^4 + 10*x^5 + 12*x^6 + 14*x^7 + 8*x^8 + ...
For n = 10 there are two odd divisors of 10: 1 and 5, so a(10) = 2*10 = 20.
MAPLE
seq(n*numtheory:-tau(n/2^padic:-ordp(n, 2)), n=1..100); # Robert Israel, Apr 26 2017
MATHEMATICA
a[ n_] := If[ n < 1, 0, n Sum[ Mod[d, 2], {d, Divisors @ n}]];
(* Second program: *)
Table[n DivisorSum[n, 1 &, OddQ], {n, 61}] (* Michael De Vlieger, Apr 24 2017 *)
PROG
(PARI) {a(n) = if( n<1, 0, n * sumdiv(n, d, d%2))};
(PARI) {a(n) = if( n<0, 0, polcoeff( sum(k=1, n, if( k%2, k * x^k / (1 - x^k)^2), x * O(x^n)), n))};
(PARI) {a(n) = if( n<1, 0, n * numdiv(n / 2^valuation(n, 2)))} \\ Fast when n has many divisors. Jens Kruse Andersen, Jul 26 2014
(Python)
from sympy import divisors
def a(n): return n*len(list(filter(lambda i: i%2==1, divisors(n)))) # Indranil Ghosh, Apr 24 2017
(Python)
from math import prod
from sympy import factorint
def A245579(n): return n*prod(e+1 for e in factorint(n>>(~n&n-1).bit_length()).values()) # Chai Wah Wu, Dec 31 2023
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Michael Somos, Jul 26 2014
EXTENSIONS
Edited by N. J. A. Sloane, Apr 27 2022
STATUS
approved