%I #41 Mar 24 2024 03:53:47
%S 1,85,145,245,1189,356717,19590671,35741759,791822369,25313027035
%N Numbers k that divide the (left) concatenation of all numbers <= k written in base 2 (most significant digit on left).
%C No other terms below 3*10^10.
%H <a href="/index/N#concat">Index entries for related sequences</a>
%t b = 2; c = {}; Select[Range[10^4], Divisible[FromDigits[c = Join[IntegerDigits[#, b], c], b], #] &] (* _Robert Price_, Mar 12 2020 *)
%o (Python)
%o from itertools import count
%o def a029471():
%o total = 0
%o power_of_two = 1
%o index_of_two = 0
%o length_of_string = 0
%o for n in count(1):
%o total += (n<<length_of_string)
%o if n == power_of_two:
%o power_of_two *= 2
%o index_of_two += 1
%o length_of_string += index_of_two
%o if total % n == 0:
%o yield n
%o # _Christian Perfect_, Feb 07 2014
%o (Python)
%o def concat_mod(base, k, mod): ... # See A029479
%o for k in range(1, 3*10**10):
%o if concat_mod(2, k, k) == 0: print(k) # _Jason Yuen_, Mar 24 2024
%Y Cf. A007088.
%Y Cf. A029447-A029470, A029471-A029494, A029495-A029518, A029519-A029542, A061931-A061954, A061955-A061978
%K nonn,base,hard,more
%O 1,2
%A _Olivier GĂ©rard_
%E One more term from Larry Reeves (larryr(AT)acm.org), Dec 03 2001
%E Edited and updated by Larry Reeves (larryr(AT)acm.org), Apr 12 2002
%E a(7)-a(8) from _Max Alekseyev_, May 12 2011
%E a(9)-a(10) from _Jason Yuen_, Mar 24 2024
|