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.

A354724 Numbers k whose ordered binary weights (A000120) of their divisors are the numbers 1 to A000005(k).

Original entry on oeis.org

1, 3, 5, 17, 25, 39, 57, 69, 145, 201, 257, 265, 289, 291, 323, 393, 579, 1075, 1083, 2307, 2645, 2875, 4205, 4503, 5555, 5593, 7955, 8815, 9399, 9401, 9519, 11033, 11155, 11407, 12297, 12455, 12711, 12909, 13205, 13281, 13611, 13737, 14001, 14915, 15879, 16629
Offset: 1

Views

Author

Amiram Eldar, Jun 04 2022

Keywords

Comments

The subsequence of terms whose divisors have binary weights in order is A255401.
All terms are odd. Proof: All binary weights must be distinct but the binary weights of k and 2*k are equal. A contradiction. - David A. Corneth, Jun 04 2022

Examples

			3 is a term since its divisors, 1 and 3, have binary weights 1 and 2, respectively.
69 is a term since its divisors, 1, 3, 23 and 69, have binary weights 1, 2, 4 and 3, respectively.
		

Crossrefs

A255401 is a subsequence.

Programs

  • Mathematica
    bw[n_] := DigitCount[n, 2, 1]; q[n_] := Module[{d = Divisors[n]}, Union[bw /@ d] == Range[Length[d]]]; Select[Range[1, 10^4, 2], q]
  • Python
    from sympy import divisors
    def binwt(n): return bin(n).count("1")
    def ok(n):
        if n%2 == 0: return False
        binwts, divs = set(), 0
        for d in divisors(n, generator=True):
            b = binwt(d)
            if b in binwts: return False
            binwts.add(b)
            divs += 1
        return binwts == set(range(1, divs+1))
    print([k for k in range(20000) if ok(k)]) # Michael S. Branicky, Jun 04 2022