login
A390089
Positive numbers that are divisible by their binary ones' complement.
1
2, 6, 10, 12, 14, 30, 42, 54, 56, 60, 62, 126, 170, 204, 238, 240, 250, 252, 254, 438, 504, 510, 682, 930, 990, 992, 1012, 1020, 1022, 1958, 2024, 2046, 2730, 3276, 3510, 3640, 3780, 3822, 3900, 3978, 3990, 4004, 4030, 4032, 4050, 4056, 4060, 4074, 4080, 4082
OFFSET
1,1
COMMENTS
As the ones' complement of an odd number is even, no terms are odd.
All terms of A020988 and A000918 are terms of this sequence.
LINKS
FORMULA
10 is a term as 10 = 1010_2 that has a ones' complement of 101_2 = 5, and 10 is divisible by 5.
MATHEMATICA
q[n_] := Module[{k = 2^IntegerLength[n, 2] - n - 1}, k > 0 && Divisible[n, k]]; Select[Range[2, 4100, 2], q] (* Amiram Eldar, Jan 17 2026 *)
PROG
(Python)
def ok(n): return (c := (n^((1 << n.bit_length()) - 1))) and n%c == 0
print([k for k in range(4083) if ok(k)]) # Michael S. Branicky, Jan 17 2026
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Scott R. Shannon, Jan 15 2026
STATUS
approved