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-1 of 1 results.

A235052 a(n) = smallest number > 1 such that a(n)^n contains a(n) as a substring.

Original entry on oeis.org

2, 5, 4, 5, 2, 4, 2, 2, 2, 2, 2, 3, 2, 4, 2, 3, 2, 2, 2, 3, 2, 3, 3, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 4, 3, 3, 2, 2, 3, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2
Offset: 1

Views

Author

Derek Orr, Jan 02 2014

Keywords

Comments

It is very probable that a(n) = 2 for n > 169.
a(n) <= 5 since 5^n ends in 5 for n > 0. - Michael S. Branicky, Jan 25 2022

Examples

			4 is the smallest number such that 4^3 contains a 4 and 4^6 contains a 4, so a(3) = 4 and a(6) = 4.
		

Crossrefs

Programs

  • Haskell
    import Data.List (isInfixOf)
    a235052 n = head [x | x <- [2..], show x `isInfixOf` (show $ x ^ n)]
    -- Reinhard Zumkeller, Jan 18 2014
    
  • Mathematica
    a[n_] := Block[{k = 2}, While[StringPosition[ToString[k^n], ToString@k] == {}, k++]; k]; Array[a, 80] (* Giovanni Resta, Jan 11 2014 *)
  • PARI
    a(n) = my(k=2); while(#strsplit(Str(k^n), Str(k))==1, k++); k; \\ Michel Marcus, Jan 25 2022
  • Python
    def f(x):
      for n in range(2,10**3):
        if str(n**x).count(str(n)) > 0:
          return n
    x = 1
    while x < 200:
      print(f(x))
      x += 1
    
  • Python
    def a(n): return min(k for k in range(2, 6) if str(k) in str(k**n))
    print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Jan 25 2022
    

Extensions

a(81) and beyond from Michael S. Branicky, Jan 25 2022
Showing 1-1 of 1 results.