login
a(n) is n times number of divisors of n if n is odd, zero if n is twice odd, n times number of divisors of n/4 if n is divisible by 4.
6

%I #15 Nov 29 2022 02:42:19

%S 1,0,6,4,10,0,14,16,27,0,22,24,26,0,60,48,34,0,38,40,84,0,46,96,75,0,

%T 108,56,58,0,62,128,132,0,140,108,74,0,156,160,82,0,86,88,270,0,94,

%U 288,147,0,204,104,106,0,220,224,228,0,118,240,122,0,378,320,260,0,134,136

%N a(n) is n times number of divisors of n if n is odd, zero if n is twice odd, n times number of divisors of n/4 if n is divisible by 4.

%H Reinhard Zumkeller, <a href="/A143520/b143520.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) is multiplicative with a(2^e) = (e-1) * 2^e if e>0, a(p^e) = (e+1) * p^e if p>2.

%F a(4*n + 2) = 0.

%F G.f.: Sum_{k>0} k * x^k / (1 - (-x)^k)^2.

%F A038040(2*n + 1) = a(2*n + 1); 4 * A038040(n) = a(4*n).

%F From _Amiram Eldar_, Nov 29 2022: (Start)

%F a(n) = n * A112329(n).

%F Dirichlet g.f.: zeta(s-1)^2*(1+2^(3-2*s)-2^(2-s)).

%F Sum_{k=1..n} a(k) ~ n^2*log(n)/4 + (4*gamma-1)*n^2/8, where gamma is Euler's constant (A001620). (End)

%e q + 6*q^3 + 4*q^4 + 10*q^5 + 14*q^7 + 16*q^8 + 27*q^9 + 22*q^11 + 24*q^12 + ...

%t Abs@Total[# (-1)^Divisors[#]] & /@ Range[68] (* _George Beck_, Oct 25 2014 *)

%t f[p_, e_] := (e + 1)*p^e; f[2, e_] := (e - 1)*2^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, Nov 29 2022 *)

%o (PARI) {a(n) = local(A, p, e); if( n<1, 0, A = factor(n); prod(k=1, matsize(A)[1], if(p = A[k, 1], e = A[k, 2]; (e - (-1)^p) * p^e)))}

%o (PARI) {a(n) = if( n<1, 0, polcoeff( sum(k=1, n, k * x^k / (1 - (-x)^k)^2, x*O(x^n)), n))}

%o (Haskell)

%o a143520 n = product $ zipWith (\p e -> (e + 2 * mod p 2 - 1) * p ^ e)

%o (a027748_row n) (a124010_row n)

%o -- _Reinhard Zumkeller_, Jan 21 2014

%Y Cf. A001620, A027748, A038040, A112329, A124010.

%K nonn,mult

%O 1,3

%A _Michael Somos_, Aug 22 2008