OFFSET
1,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000
EXAMPLE
a(3) = 7 since 7^1 contains no 1, 7^2 contains no 2 and 7^3 contains a 3.
MAPLE
a:= proc(n) local b; for b from 2 while
searchtext(""||n, ""||(b^n))=0 do od; b
end:
seq(a(n), n=1..100); # Alois P. Heinz, Sep 28 2016
MATHEMATICA
Table[b = 2; While[Length@ SequencePosition[IntegerDigits[b^n], IntegerDigits[n]] == 0, b++]; b, {n, 120}] (* Michael De Vlieger, Sep 28 2016, Version 10.1 *)
PROG
(Python)
def a(n):
b, s = 2, str(n)
while s not in str(b**n): b += 1
return b
print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Oct 05 2021
CROSSREFS
KEYWORD
AUTHOR
Erich Friedman, Jun 06 2001
STATUS
approved