login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A238508 Smallest number m such that 3^m contains a string of n consecutive decreasing integers in its decimal representation. 0
0, 5, 13, 50, 213, 536, 536, 4582, 63202, 163984 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
5 is the smallest exponent such that 3^5 contains two consecutive decreasing integers (3^5 = 243).
13 is the smallest exponent such that 3^13 contains three consecutive decreasing integers (3^13 = 1594323).
PROG
(Python)
def StrDec(x):
..for n in range(10**5):
....count = 0
....i = 0
....string = str(3**n)
....if len(string) == x and x == 1:
......return n
....while i < len(string)-1:
......if int(string[i]) == int(string[i+1])-1:
........count += 1
........i += 1
......else:
........if count >= x-1:
..........return n
........else:
..........count = 0
..........i += 1
....if count >= x-1:
......return n
x = 1
while x < 15:
..print(StrDec(x))
..x += 1
CROSSREFS
Sequence in context: A146689 A146657 A243304 * A151274 A149538 A149539
KEYWORD
nonn,base,fini,full
AUTHOR
Derek Orr, Feb 27 2014
EXTENSIONS
a(9)-a(10) from Giovanni Resta, Mar 02 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 18 23:41 EDT 2024. Contains 375284 sequences. (Running on oeis4.)