|
|
A029471
|
|
Numbers k that divide the (left) concatenation of all numbers <= k written in base 2 (most significant digit on left).
|
|
141
|
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
No other terms below 10^8.
|
|
LINKS
|
|
|
MATHEMATICA
|
b = 2; c = {}; Select[Range[10^4], Divisible[FromDigits[c = Join[IntegerDigits[#, b], c], b], #] &] (* Robert Price, Mar 12 2020 *)
|
|
PROG
|
(Python)
from itertools import count
def a029471():
total = 0
power_of_two = 1
index_of_two = 0
length_of_string = 0
for n in count(1):
total += (n<<length_of_string)
if n == power_of_two:
power_of_two *= 2
index_of_two += 1
length_of_string += index_of_two
if total % n == 0:
yield n
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,hard,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
One more term from Larry Reeves (larryr(AT)acm.org), Dec 03 2001
Edited and updated by Larry Reeves (larryr(AT)acm.org), Apr 12 2002
|
|
STATUS
|
approved
|
|
|
|