cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A238507 Smallest number m such that 3^m contains a string of n consecutive increasing integers in its decimal representation.

Original entry on oeis.org

0, 8, 20, 57, 332, 332, 6814, 7926, 16724, 200633
Offset: 1

Views

Author

Derek Orr, Feb 27 2014

Keywords

Examples

			8 is the smallest exponent such that 3^8 contains two consecutive increasing integers (3^8 = 6561).
20 is the smallest exponent such that 3^20 contains three consecutive increasing integers (3^20 = 3486784401).
		

Crossrefs

Programs

  • Python
    def StrInc(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(StrInc(x))
      x += 1

Extensions

a(8)-a(10) from Giovanni Resta, Mar 02 2014