login
A380844
The number of divisors of n that have the same binary weight as n.
0
1, 2, 1, 3, 1, 2, 1, 4, 2, 2, 1, 3, 1, 2, 1, 5, 1, 4, 1, 3, 2, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 6, 2, 2, 2, 6, 1, 2, 1, 4, 1, 4, 1, 3, 2, 2, 1, 5, 2, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 7, 2, 4, 1, 3, 1, 4, 1, 8, 1, 2, 2, 3, 1, 2, 1, 5, 1, 2, 1, 6, 1, 2, 1
OFFSET
1,2
COMMENTS
First differs from A325565 at n = 133: a(133) = 3 while A325565(133) = 2.
The sum of these divisors is A380845(n).
LINKS
FORMULA
a(n) = Sum_{d|n} [A000120(d) = A000120(n)], where [ ] is the Iverson bracket.
a(2^n) = n+1.
a(n) <= A000005(n) with equality if and only if n is a power of 2.
a(n) = a(A000265(n)) * (A007814(n)+1), or equivalently, a(k*2^n) = a(k)*(n+1) for k odd and n >= 0.
In particular, since a(p) = 1 for an odd prime p, a(p*2^n) = n+1 for an odd prime p and n >= 0.
a(A000396(n)) = A000043(n), assuming that odd perfect numbers do no exist.
EXAMPLE
a(6) = 2 because 6 = 110_2 has binary weight 2, and 2 of its divisors, 3 = 11_2 and 6, have the same binary weight.
MATHEMATICA
a[n_] := Module[{h = DigitCount[n, 2, 1]}, DivisorSum[n, 1 &, DigitCount[#, 2, 1] == h &]]; Array[a, 100]
PROG
(PARI) a(n) = {my(h = hammingweight(n)); sumdiv(n, d, hammingweight(d) == h); }
KEYWORD
nonn,base,easy,new
AUTHOR
Amiram Eldar, Feb 05 2025
STATUS
approved