|
|
A244851
|
|
Least number k > 0 such that 3^k begins with exactly n consecutive decreasing digits.
|
|
3
|
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
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
|
|
LINKS
|
|
|
EXAMPLE
|
3^7 = 2187 begins with 2 consecutive decreasing digits ('21'). Thus a(2) = 7.
|
|
PROG
|
(Python)
def a(n):
..for k in range(1, 10**5):
....st = str(3**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
|
|
|
|