%I #4 Jun 21 2014 22:38:41
%S 3,6,7,3,8,8,6,5,7,8,3,4,1,3,1,7,7,7,5,4,9,8,9,1,9,6,3,2,7,0,3,3,8,1,
%T 8,2,7,7,3,0,3,5,7,0,0,3,9,7,1,7,2,9,6,1,1,3,0,9,3,0,0,9,5,9,5,0,1,6,
%U 6,2,0,9,2,1,5,6,4,6,8,6,9,9,3,2,7,7,7,0,3,1,8,5,3,0
%N a(n) is the repeating digit in 3^A243975(n).
%C In case of a tie, choose the smaller integer.
%e 3^A243975(4) = 3^29 = 68630377364883 contains four 3's. Thus A243975(4) = 29 and since the repeating digit is 3, a(4) = 3.
%o (Python)
%o def b():
%o ..n = 1
%o ..k = 1
%o ..while k < 50000:
%o ....st = str(3**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. A243975.
%K nonn,base
%O 1,1
%A _Derek Orr_, Jun 16 2014
|