%I #16 Nov 24 2015 17:38:13
%S 1,17,149,146,7997,45419,3972963,27487124,406680034
%N Least number k > 0 such that 3^k begins with exactly n consecutive increasing digits.
%e 3^17 = 129140163 begins with 2 consecutive increasing digits ('12'). Thus a(2) = 17.
%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, A244851.
%K nonn,base,fini,full
%O 1,2
%A _Derek Orr_, Jul 07 2014
%E a(7)-a(9) from _Hiroaki Yamanouchi_, Jul 10 2014
|