OFFSET
1,1
COMMENTS
1 <= a(n) <= 10.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A067442(n)^(1/n) for n >= 2.
EXAMPLE
a(3)=5 because 5^3=125 starts with 1, and none of 2^3, 3^3, 4^3 do.
MAPLE
f:= proc(n) local d, x, y;
for x from 2 to 10 do
y:= x^n;
if floor(y/10^ilog10(y)) = 1 then return x fi
od
end proc:
map(f, [$1..100]);
MATHEMATICA
lik[n_]:=Module[{k=2}, While[IntegerDigits[k^n][[1]]!=1, k++]; k]; Array[ lik, 100] (* Harvey P. Dale, Dec 06 2019 *)
PROG
(Magma) m:=1; sol:=[]; for n in [1..100] do k:=2; while Reverse(Intseq(k^n))[1] ne 1 do k:=k+1; end while; sol[m]:=k; m:=m+1; end for; sol; // Marius A. Burtea, Aug 15 2019
(PARI) a(n) = {my(k=2); while(digits(k^n)[1] != 1, k++); k; } \\ Michel Marcus, Aug 15 2019
(Python)
print(1, 10)
n = 1
while n < 100:
n, p = n+1, 2
s = str(p**n)
while s[0] != "1":
p = p+1
s = str(p**n)
print(n, p) # A.H.M. Smeets, Aug 16 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Aug 13 2019
STATUS
approved