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.

A131546 Least power of 3 having exactly n consecutive 7's in its decimal representation.

Original entry on oeis.org

3, 11, 112, 184, 721, 3520, 6643, 12793, 67448, 208380, 364578, 1123485, 9549790, 23340555, 88637856
Offset: 1

Views

Author

Shyam Sunder Gupta, Aug 26 2007

Keywords

Comments

No more terms < 10^8. - Bert Dobbelaere, Mar 20 2019

Examples

			a(2) = 11 because 3^11 = 177147 is the smallest power of 3 to contain a run of two consecutive 7's in its decimal form.
		

Crossrefs

Programs

  • Mathematica
    a = ""; Do[ a = StringJoin[a, "7"]; b = StringJoin[a, "7"]; k = 1; While[ StringPosition[ ToString[3^k], a] == {} || StringPosition[ ToString[3^k], b] != {}, k++ ]; Print[k], {n, 10} ]
  • Python
    import sys
    sys.set_int_max_str_digits(1000000)
    def A131546(n):
        str7 = '7'*n
        x, exponent = 3, 1
        while not str7 in str(x):
            exponent += 1
            x *= 3
        return exponent # Chai Wah Wu, Aug 05 2014

Formula

a(1) = A063566(7). - Michel Marcus, Aug 05 2014

Extensions

a(11)-a(13) from Lars Blomberg, Feb 02 2013
a(14)-a(15) from Bert Dobbelaere, Mar 20 2019

A062520 3^a(n) is smallest nonnegative power of 3 containing n.

Original entry on oeis.org

10, 0, 3, 1, 5, 8, 8, 3, 4, 2, 21, 19, 17, 22, 11, 13, 17, 11, 7, 9, 18, 7, 19, 13, 5, 26, 19, 3, 24, 6, 16, 12, 13, 31, 15, 21, 24, 29, 18, 31, 17, 12, 18, 5, 12, 28, 16, 11, 15, 10, 35, 32, 33, 12, 26, 27, 8, 40, 26, 10, 21, 8, 19, 17, 24, 8, 33, 16, 9, 14, 35, 11, 6, 29, 18, 47
Offset: 0

Views

Author

Robert G. Wilson v, Jun 24 2001

Keywords

Examples

			a(1) = 0 since 3^0 = 1. a(2) = a(7) = a(27) = 3 because 3^3 = 27.
		

Crossrefs

Cf. A030000. Essentially the same as A063566. Cf. A000244.

Programs

  • Maple
    N:= 99:
    count:= 1: A["0"]:= 10:
    for n from 0 while count <= N do
      S:= convert(3^n,string); nS:= length(S);
      for m from 1 to 2 while count <= N do
        for i from 1 to nS+1-m while count <= N do
          if S[i] <> "0" and not assigned(A[S[i..i+m-1]]) then
             count:= count+1; A[S[i..i+m-1]]:= n;
          fi
        od
      od
    od:
    seq(A[convert(n,string)],n=0..N); # Robert Israel, Jun 14 2018
  • Mathematica
    Table[k = 0; While[ StringPosition[ ToString[3^k], ToString[n] ] == {}, k++ ]; k, {n, 0, 75} ]
  • Python
    def a(n):
        s, k = str(n), 0
        while s not in str(3**k): k += 1
        return k
    print([a(n) for n in range(76)]) # Michael S. Branicky, Oct 04 2021

A248018 Least number k > 0 such that n^k contains n*R_n in its decimal representation, or 0 if no such k exists.

Original entry on oeis.org

1, 43, 119, 96, 186, 1740, 6177, 8421, 104191, 0, 946417
Offset: 1

Views

Author

Talha Ali, Sep 29 2014

Keywords

Comments

R_n is the repunit of length n, i.e., R_n = (10^n-1)/9, A002275.
a(10^n) = 0 for all n > 0. - Derek Orr, Sep 29 2014
a(9) > 86000. - Derek Orr, Sep 29 2014
Note that a(2) = A030000(22), and a(3) = A063566(333), and that sequence is also related in a similar way to sequences from A063567 up to A063572. - Michel Marcus, Sep 30 2014

Examples

			a(2) = 43 because 2^43 = 8796093022208 has the string '22' in it and 43 is the smallest power of 2 that produces such a result.
a(3) = 119 because 3^119 = 599003433304810403471059943169868346577158542512617035467 contains the string '333', and 119 is the smallest power of 3 that gives us such a result.
		

Crossrefs

Cf. A002275.

Programs

  • Python
    def a(n):
      s = str(n)
      p = len(s)
      if s.count('1') == 1 and s.count('0') == p - 1:
        return 0
      k = 1
      while not str(n**k).count(n*s):
        k += 1
      return k
    n = 1
    while n < 10:
      print(a(n),end=', ')
      n += 1
    # Derek Orr, Sep 29 2014

Extensions

a(3) and a(5) corrected, a(6)-a(8) added by Derek Orr, Sep 29 2014
a(4) corrected and a(9)-a(11) added by Hiroaki Yamanouchi, Oct 01 2014
Showing 1-3 of 3 results.