%I #13 Jul 12 2014 19:14:44
%S 1,7,314,1655,11569,383374,3052836,31843469,458415111,164840426684
%N Least number k > 0 such that 3^k begins with exactly n consecutive decreasing digits.
%C The leading digit of the resulting powers of 3 are: 3, 2, 6, 4, 6, 7, 8, 7, 8, 9. - _Michel Marcus_, Jul 11 2014
%e 3^7 = 2187 begins with 2 consecutive decreasing digits ('21'). Thus a(2) = 7.
%o (Python)
%o def a(n):
%o ..for k in range(1,10**5):
%o ....st = str(3**k)
%o ....count = 0
%o ....if len(st) > n:
%o ......for i in range(len(st)):
%o ........if int(st[i]) == int(st[i+1])+1:
%o ..........count += 1
%o ........else:
%o ..........break
%o ......if count == n:
%o ........return k
%o n = 0
%o while n < 10:
%o ..print(a(n),end=', ')
%o ..n += 1
%Y Cf. A244848, A244849, A244852.
%K nonn,base,fini,full
%O 1,2
%A _Derek Orr_, Jul 07 2014
%E a(6)-a(10) from _Hiroaki Yamanouchi_, Jul 11 2014
|