OFFSET
1,3
COMMENTS
EXAMPLE
60 = 2^5 + 2^4 + 2^3 + 2^2 and 60 is divisible by 5+1, 4+1, 3+1 and 2+1, so 60 belongs to the sequence.
42 = 2^5 + 2^3 + 2^1 and 42 is not divisible by 3+1, so 42 does not belong to the sequence.
MATHEMATICA
Select[Range[20000], Function[n, AllTrue[Position[Reverse@ IntegerDigits[n, 2], 1][[All, 1]], Divisible[n, #] &]]] (* Michael De Vlieger, Dec 12 2022 *)
PROG
(PARI) is(n) = { my (r=n, k); while (r, r-=2^k=valuation(r, 2); if (n%(k+1), return (0); ); ); return (1); }
(Python)
def ok(n): return all(n%(k+1) == 0 or not n&(1<<k) for k in range(n.bit_length()))
print([m for m in range(20000) if ok(m)]) # Michael S. Branicky, Dec 07 2022
(Python)
from itertools import count, islice
def A358970_gen(startvalue=0): # generator of terms >= startvalue
return filter(lambda n:not any(n%i for i, b in enumerate(bin(n)[:1:-1], 1) if b=='1'), count(max(startvalue, 0)))
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Rémy Sigrist, Dec 07 2022
STATUS
approved