%I #17 Nov 24 2015 17:37:49
%S 1,7,90,155,8290,63293,4338436,5194868,62759188
%N Least number k > 0 such that 2^k begins with exactly n consecutive increasing digits.
%C The leading digit of the resulting powers of 2 are: 2, 1, 1, 4, 3, 1, 2, 1, 1. - _Michel Marcus_, Jul 11 2014
%e 2^7 = 128 begins with 2 consecutive increasing digits ('12'). Thus a(2) = 7.
%o (Python)
%o def a(n):
%o ..for k in range(1,10**5):
%o ....st = str(2**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, A244851, A244852.
%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
|