login
A368397
a(n) is the least number k not ending in 0 such that k^n has at least n 0's in its decimal expansion.
1
101, 101, 101, 101, 101, 351, 518, 194, 1001, 951, 3231, 3757, 2169, 999, 1397, 2273, 9723, 8683, 13219, 6152, 15204, 18898, 39484, 10001, 10001, 35586, 46564, 35085, 71061, 100001, 43055, 43642, 83055, 44411, 36802, 94501, 135852, 52299, 174062, 121201, 173388, 119032, 215365, 94996, 201312
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
Sequence in context: A282223 A282200 A266667 * A241495 A282980 A282950
KEYWORD
nonn,base
AUTHOR
Robert Israel, Dec 22 2023
STATUS
approved