login
Total number of 1's in binary expansion of all divisors of 2^n-1.
1

%I #13 May 17 2022 17:47:34

%S 1,3,4,9,6,17,8,27,16,33,20,100,14,44,42,81,18,186,20,293,80,118,38,

%T 634,62,77,64,523,80,813,32,243,153,99,154,5031,58,110,189,1918,67,

%U 1624,115,1545,761,226,120,9366,64,1728,472,1861,135,2162,945,3471,261,1056,101,73418

%N Total number of 1's in binary expansion of all divisors of 2^n-1.

%H Michel Marcus, <a href="/A354112/b354112.txt">Table of n, a(n) for n = 1..300</a>

%F a(n) = A093653(A000225(n)).

%p a:= n-> add(add(i, i=Bits[Split](d)), d=numtheory[divisors](2^n-1)):

%p seq(a(n), n=1..60); # _Alois P. Heinz_, May 17 2022

%t a[n_] := Total[DigitCount[Divisors[2^n - 1], 2, 1]]; Array[a, 60] (* _Amiram Eldar_, May 17 2022 *)

%o (PARI) a(n) = sumdiv(2^n-1, d, hammingweight(d));

%o (Python 3.10+)

%o # if python version < 3.10, replace d.bitcount() with bin(d).count('1')

%o from sympy import divisors

%o def A354112(n): return sum(d.bit_count() for d in divisors(2**n-1,generator=True)) # _Chai Wah Wu_, May 17 2022

%Y Cf. A000225, A093653.

%K nonn,base

%O 1,2

%A _Michel Marcus_, May 17 2022