OFFSET
1,1
COMMENTS
LINKS
Scott R. Shannon, Table of n, a(n) for n = 1..1551
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
