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.

This page as a plain text file.
%I A238507 #12 May 22 2025 10:21:37
%S A238507 0,8,20,57,332,332,6814,7926,16724,200633
%N A238507 Smallest number m such that 3^m contains a string of n consecutive increasing integers in its decimal representation.
%e A238507 8 is the smallest exponent such that 3^8 contains two consecutive increasing integers (3^8 = 6561).
%e A238507 20 is the smallest exponent such that 3^20 contains three consecutive increasing integers (3^20 = 3486784401).
%o A238507 (Python)
%o A238507 def StrInc(x):
%o A238507   for n in range(10**5):
%o A238507     count = 0
%o A238507     i = 0
%o A238507     string = str(3**n)
%o A238507     if len(string) == x and x == 1:
%o A238507       return n
%o A238507     while i < len(string)-1:
%o A238507       if int(string[i]) == int(string[i+1])-1:
%o A238507         count += 1
%o A238507         i += 1
%o A238507       else:
%o A238507         if count >= x-1:
%o A238507           return n
%o A238507         else:
%o A238507           count = 0
%o A238507           i += 1
%o A238507     if count >= x-1:
%o A238507       return n
%o A238507 x = 1
%o A238507 while x < 15:
%o A238507   print(StrInc(x))
%o A238507   x += 1
%Y A238507 Cf. A238448, A215727.
%K A238507 nonn,base,fini,full
%O A238507 1,2
%A A238507 _Derek Orr_, Feb 27 2014
%E A238507 a(8)-a(10) from _Giovanni Resta_, Mar 02 2014