login
A380845
The sum of divisors of n that have the same binary weight as n.
16
1, 3, 3, 7, 5, 9, 7, 15, 12, 15, 11, 21, 13, 21, 15, 31, 17, 36, 19, 35, 28, 33, 23, 45, 25, 39, 27, 49, 29, 45, 31, 63, 36, 51, 42, 84, 37, 57, 39, 75, 41, 84, 43, 77, 60, 69, 47, 93, 56, 75, 51, 91, 53, 81, 55, 105, 57, 87, 59, 105, 61, 93, 63, 127, 70, 108
OFFSET
1,2
COMMENTS
The number of these divisors is A380844(n).
LINKS
FORMULA
a(n) = Sum_{d|n} d * [A000120(d) = A000120(n)], where [ ] is the Iverson bracket.
a(2^n) = 2^(n+1) - 1.
a(n) <= A000203(n) with equality if and only if n is a power of 2.
a(n) = a(A000265(n)) * (2^(A007814(n)+1)-1) = a(A000265(n)) * A038712(n), or equivalently, a(k*2^n) = a(k)*(2^(n+1)-1) for k odd and n >= 0.
In particular, since a(p) = p for an odd prime p, a(p*2^n) = p*(2^(n+1)-1) for an odd prime p and n >= 0.
a(A000396(n)) = A000668(n)^2, assuming that odd perfect numbers do no exist.
EXAMPLE
a(6) = 9 because 6 = 110_2 has binary weight 2, 2 of its divisors, 3 = 11_2 and 6, have the same binary weight, and 3 + 6 = 9.
MATHEMATICA
a[n_] := Module[{h = DigitCount[n, 2, 1]}, DivisorSum[n, # &, DigitCount[#, 2, 1] == h &]]; Array[a, 100]
PROG
(PARI) a(n) = {my(h = hammingweight(n)); sumdiv(n, d, d * (hammingweight(d) == h)); }
KEYWORD
nonn,base,easy
AUTHOR
Amiram Eldar, Feb 05 2025
STATUS
approved