login
A354724
Numbers k whose ordered binary weights (A000120) of their divisors are the numbers 1 to A000005(k).
3
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,2
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
LINKS
EXAMPLE
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.
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]
PROG
(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
CROSSREFS
A255401 is a subsequence.
Sequence in context: A333199 A203193 A079649 * A255401 A364959 A263811
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Jun 04 2022
STATUS
approved