OFFSET
1,2
COMMENTS
It seems very likely a(n) < 10 for all n (even stronger, a(n) < 9 for all n).
It also seems very likely a(n) = {1,2,3} for sufficiently large n.
Counterexample: a(10^d - 2) = 6 for d >= 2. - Robert Israel, Sep 16 2024
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..10000
FORMULA
a(A011531(k))=1, any k.
a(10*n) = a(n) if a(n) < 10. - Robert Israel, Sep 16 2024
EXAMPLE
5^1 = 5 does not contain a 1 but 5^2 = 25 does contain a 2 so a(5) = 2.
7^1 = 7 does not contain a 1, 7^2 = 49 does not contain a 2, but 7^3 = 343 does contain a 3 so a(7) = 3.
MAPLE
f:= proc(n) local k;
for k from 1 to 9 do
if member(k, convert(n^k, base, 10)) then return k fi
od;
FAIL
end proc:
map(f, [$1..100]); # Robert Israel, Sep 16 2024
MATHEMATICA
a[n_] := Block[{k=1}, While[{} == StringPosition[ ToString[n^k], ToString[k]], k++]; k]; Array[a, 84] (* Giovanni Resta, Mar 11 2014 *)
sk[n_]:=Module[{k=1}, While[SequenceCount[IntegerDigits[n^k], IntegerDigits[k]] == 0, k++]; k]; Array[sk, 90] (* Harvey P. Dale, May 12 2022 *)
PROG
(Python)
def Sub(x):
for n in range(10**3):
if str(x**n).find(str(n)) > -1:
return n
x = 1
while x < 10**3:
print(Sub(x))
x += 1
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Derek Orr, Mar 10 2014
STATUS
approved