%I #5 Jun 21 2014 22:38:04
%S 2,5,4,8,9,1,8,9,1,8,3,5,1,6,7,3,1,4,7,5,1,2,8,0,7,7,8,1,4,1,8,5,7,5,
%T 9,4,8,1,6,7,3,5,0,4,9,8,6,7,4,1,6,3,0,2,9,8,4,5,8,9,2,3,0,3,3,5,1,6,
%U 3,4,6,6,8,6,4,8,4,6,5,7,4,1,1,7,1,1,9,3,2,5,2,2,3
%N a(n) is the repeating digit in 2^A243972(n).
%C In case of a tie, choose the smaller integer.
%e 2^A243972(4) = 2^23 = 8388608 contains four 8's. Thus A243972(4) = 23 and here, since 8 is the repeating digit, a(4) = 8.
%o (Python)
%o def b():
%o ..n = 1
%o ..k = 1
%o ..while k < 50000:
%o ....st = str(2**k)
%o ....if len(st) >= n:
%o ......for a in range(10):
%o ........count = 0
%o ........for i in range(len(st)):
%o ..........if st[i] == str(a):
%o ............count += 1
%o ........if count == n:
%o ..........print(a,end=', ')
%o ..........n += 1
%o ..........k = 0
%o ..........break
%o ......k += 1
%o ....else:
%o ......k += 1
%o b()
%Y Cf. A243972.
%K nonn,base
%O 1,1
%A _Derek Orr_, Jun 16 2014
|