A380844 The number of divisors of n that have the same binary weight as n.
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
Examples
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.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
a[n_] := Module[{h = DigitCount[n, 2, 1]}, DivisorSum[n, 1 &, DigitCount[#, 2, 1] == h &]]; Array[a, 100]
-
PARI
a(n) = {my(h = hammingweight(n)); sumdiv(n, d, hammingweight(d) == h);}
Formula
a(2^n) = n+1.
a(n) <= A000005(n) with equality if and only if n is a power of 2.
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.
Comments