login
A235052
a(n) = smallest number > 1 such that a(n)^n contains a(n) as a substring.
2
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,1
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
LINKS
EXAMPLE
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.
MATHEMATICA
a[n_] := Block[{k = 2}, While[StringPosition[ToString[k^n], ToString@k] == {}, k++]; k]; Array[a, 80] (* Giovanni Resta, Jan 11 2014 *)
PROG
(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
(Haskell)
import Data.List (isInfixOf)
a235052 n = head [x | x <- [2..], show x `isInfixOf` (show $ x ^ n)]
-- Reinhard Zumkeller, Jan 18 2014
(PARI) a(n) = my(k=2); while(#strsplit(Str(k^n), Str(k))==1, k++); k; \\ Michel Marcus, Jan 25 2022
CROSSREFS
Sequence in context: A095758 A299212 A249018 * A102066 A279404 A072970
KEYWORD
nonn,base
AUTHOR
Derek Orr, Jan 02 2014
EXTENSIONS
a(81) and beyond from Michael S. Branicky, Jan 25 2022
STATUS
approved