The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A358970 Nonnegative numbers m such that if 2^k appears in the binary expansion of m, then k+1 divides m. 0
0, 1, 2, 6, 8, 12, 36, 60, 128, 136, 168, 261, 288, 520, 530, 540, 630, 640, 1056, 2052, 2088, 2100, 2184, 2208, 2304, 2340, 2520, 2580, 4134, 8232, 8400, 8820, 9240, 10248, 10920, 16440, 16560, 16920, 16950, 17010, 17040, 17190, 17280, 18480, 18600, 18720 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
In other words, numbers whose binary expansion encodes a subset of their divisors.
Also numbers m divisible by A271410(m).
This sequence is infinite as it contains A058891.
LINKS
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)))
A358970_list = list(islice(A358970_gen(), 20)) # Chai Wah Wu, Dec 12 2022
CROSSREFS
Sequence in context: A065392 A030457 A296300 * A224470 A168247 A229056
KEYWORD
nonn,base,easy
AUTHOR
Rémy Sigrist, Dec 07 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 10 10:32 EDT 2024. Contains 373264 sequences. (Running on oeis4.)