OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..320
EXAMPLE
a(6) = 351 because 351^6 = 1870004703089601 has 6 0's, and this is the smallest number not ending in 0 that works.
MAPLE
f:= proc(n) local k;
for k from 2 do
if k mod 10 <> 0 and numboccur(0, convert(k^n, base, 10)) >= n then return k fi
od
end proc:
map(f, [$1..50]);
MATHEMATICA
a={}; For[n=1, n<=45, n++, k=1; While[Mod[k, 10]==0 || Count[IntegerDigits[k^n, 10], 0] < n, k++]; AppendTo[a, k]]; a (* Stefano Spezia, Dec 22 2023 *)
PROG
(PARI)
a(n) = {
forstep(i = 11, oo, [1, 1, 1, 1, 1, 1, 1, 1, 2],
d = digits(i^n);
t = 0;
for(j = 1, #d,
t+=(!d[j])
);
if(t >= n,
return(i)
)
)
} \\ David A. Corneth, Dec 22 2023
(Python)
from gmpy2 import digits
from itertools import count
def a(n): return next(k for k in count(1) if k%10 and digits(k**n).count('0')>=n)
print([a(n) for n in range(1, 46)]) # Michael S. Branicky, Jan 05 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Dec 22 2023
STATUS
approved