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.

Showing 1-3 of 3 results.

A238449 Smallest numbers m such that 2^m contains a string of n consecutive decreasing integers in its decimal representation.

Original entry on oeis.org

0, 5, 25, 78, 161, 341, 1315, 28238, 56047, 283789
Offset: 1

Views

Author

Derek Orr, Feb 26 2014

Keywords

Comments

This is an increasing sequence (not necessarily strictly increasing).

Examples

			5 is the smallest exponent such that 2^5 contains two consecutive decreasing integers (2^5 = 32).
25 is the smallest exponent such that 2^25 contains three consecutive decreasing integers (2^25 = 33554432).
		

Crossrefs

Programs

  • Mathematica
    a[1] = 0; a[n_] := Block[{k = 4, p = 16}, While[Max[ Length /@  Select[ Split@ Differences@ IntegerDigits@p, First@# == -1 &]] < n-1, k++; p *= 2]; k]; a/@ Range[7] (* Giovanni Resta, Feb 26 2014 *)
  • Python
    def StrDec(x):
      for n in range(10**5):
        count = 0
        i = 0
        if len(str(2**n)) == x and x == 1:
          return n
        while i < len(str(2**n))-1:
          if int(str(2**n)[i]) == int(str(2**n)[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 < 50:
      print(StrDec(x))
      x += 1

Extensions

a(8)-a(10) from Giovanni Resta, Feb 26 2014

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

A243150 Least number k > 0 such that 2^k contains an n-digit long substring of the infinite string "0123456789012345678901234567890123456....".

Original entry on oeis.org

1, 7, 28, 106, 391, 992, 1178, 7255, 15975, 67143, 333212, 333212, 1641257
Offset: 1

Views

Author

Derek Orr, May 31 2014

Keywords

Comments

By A238448, a(10) <= 244178.

Examples

			2^7 = 128 contains the 2-digit substring "12". Thus a(2) = 7.
		

Crossrefs

Cf. A238448.

Programs

  • Python
    import sys
    sys.set_int_max_str_digits(5000)
    def a(n):
      for k in range(1, 10**5):
        for i in range(10):
          s = ''
          for j in range(i, i+n):
            dig=j%10
            s+=str(dig)
          if str(2**k).find(s) > -1:
            return k
    n=1
    while n < 10:
      print(a(n))
      n+=1

Extensions

a(10)-a(13) from Hiroaki Yamanouchi, Sep 26 2014
Showing 1-3 of 3 results.