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.

A176763 Smallest power of 3 whose decimal expansion contains n.

Original entry on oeis.org

59049, 1, 27, 3, 243, 6561, 6561, 27, 81, 9, 10460353203, 1162261467, 129140163, 31381059609, 177147, 1594323, 129140163, 177147, 2187, 19683, 387420489, 2187, 1162261467, 1594323, 243, 2541865828329, 1162261467, 27, 282429536481, 729, 43046721, 531441, 1594323
Offset: 0

Views

Author

Jonathan Vos Post, Apr 25 2010

Keywords

Comments

This is to 3 as A030001 is to 2.

Examples

			a(1) = 1 because 3^0 = 1 has "1" as a substring (not a proper substring, though).
a(2) = 27 because 3^3 = 27 has "2" as a substring.
a(10) = 10460353203 because 3^21 = 10460353203 is the smallest power of 3 whose decimal expansion contains "10" (in this case, "10" happens to be the left-hand or initial digits, but that is not generally true).
		

Crossrefs

Programs

  • Mathematica
    A176763[n_] := Block[{k = -1}, While[StringFreeQ[IntegerString[3^++k], IntegerString[n]]]; 3^k]; Array[A176763, 50, 0] (* Paolo Xausa, Apr 03 2024 *)
  • Python
    def a(n):
        k, strn = 0, str(n)
        while strn not in str(3**k): k += 1
        return 3**k
    print([a(n) for n in range(33)]) # Michael S. Branicky, Apr 03 2024

Formula

a(n) = MIN{A000244(i) such that n in decimal representation is a substring of A000244(i)}.

Extensions

More terms from Sean A. Irvine and Jon E. Schoenfield, May 05 2010
a(0) prepended by Paolo Xausa, Apr 03 2024