cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A380844 The number of divisors of n that have the same binary weight as n.

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Feb 05 2025

Keywords

Comments

First differs from A325565 at n = 133: a(133) = 3 while A325565(133) = 2.
The sum of these divisors is A380845(n).

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.
		

Crossrefs

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(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.