%I #39 Sep 24 2024 10:05:59
%S 1,5,7,5,6,8,7,1,9,9,6,3,2,9,1,4,1
%N a(n) is the first digit to appear n times in succession in a power of 2.
%C Assumes that there are no 2 digits that appear n times in succession for the first time in the same power of 2. - _Chai Wah Wu_, Apr 26 2019
%e 2^16 = 65536 is the first power of 2 with a repeated digit (cf. A045875), with 5 repeated, so a(2) = 5. - _N. J. A. Sloane_, Aug 23 2012
%t n = 1; x = 1; lst = {};
%t For[i = 1, i <= 10000, i++,
%t z = Split[IntegerDigits[x]]; a = Length /@ z; b = Max[a];
%t For[j = n, j <= b, j++,
%t AppendTo[lst, First[First[Part[z, First[Position[a, b]]]]]]; n++
%t ]; x = 2 x ]; lst (* _Robert Price_, Mar 16 2019 *)
%o (Python)
%o def A215732(n):
%o l, x = [str(d)*n for d in range(10)], 1
%o for m in range(10**9):
%o s = str(x)
%o for k in range(10):
%o if l[k] in s:
%o return k
%o x *= 2
%o return 'search limit reached'
%o # _Chai Wah Wu_, Dec 17 2014
%Y Cf. A045875, A215733, A215734, A215735.
%K nonn,base,hard,more
%O 1,2
%A _V. Raman_, Aug 22 2012
%E a(11)-a(13) added by _T. D. Noe_, Sep 04 2012
%E a(14) added by _T. D. Noe_, Sep 06 2012
%E a(15) from _Bert Dobbelaere_, Feb 25 2019
%E a(16) from _Paul Geneau de Lamarlière_, Jun 26 2024
%E a(17) from _Paul Geneau de Lamarlière_, Sep 24 2024