|
|
A244848
|
|
Least number k > 0 such that 2^k begins with exactly n consecutive decreasing digits.
|
|
3
|
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
EXAMPLE
|
2^201 begins "32138760885...". Since it starts with a run of 3 consecutive decreasing digits and 201 is the smallest power to have this property, a(3) = 201.
|
|
PROG
|
(Python)
def a(n):
..for k in range(1, 10**5):
....st = str(2**k)
....count = 0
....if len(st) > n:
......for i in range(len(st)):
........if int(st[i]) == int(st[i+1])+1:
..........count += 1
........else:
..........break
......if count == n:
........return k
n = 0
while n < 10:
..print(a(n), end=', ')
..n += 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,fini,full
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|