login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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

%I #17 Jan 05 2024 08:06:24

%S 101,101,101,101,101,351,518,194,1001,951,3231,3757,2169,999,1397,

%T 2273,9723,8683,13219,6152,15204,18898,39484,10001,10001,35586,46564,

%U 35085,71061,100001,43055,43642,83055,44411,36802,94501,135852,52299,174062,121201,173388,119032,215365,94996,201312

%N 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.

%H Michael S. Branicky, <a href="/A368397/b368397.txt">Table of n, a(n) for n = 1..320</a>

%e a(6) = 351 because 351^6 = 1870004703089601 has 6 0's, and this is the smallest number not ending in 0 that works.

%p f:= proc(n) local k;

%p for k from 2 do

%p if k mod 10 <> 0 and numboccur(0, convert(k^n,base,10)) >= n then return k fi

%p od

%p end proc:

%p map(f, [$1..50]);

%t 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 *)

%o (PARI)

%o a(n) = {

%o forstep(i = 11, oo, [1,1,1,1,1,1,1,1,2],

%o d = digits(i^n);

%o t = 0;

%o for(j = 1, #d,

%o t+=(!d[j])

%o );

%o if(t >= n,

%o return(i)

%o )

%o )

%o } \\ _David A. Corneth_, Dec 22 2023

%o (Python)

%o from gmpy2 import digits

%o from itertools import count

%o def a(n): return next(k for k in count(1) if k%10 and digits(k**n).count('0')>=n)

%o print([a(n) for n in range(1, 46)]) # _Michael S. Branicky_, Jan 05 2024

%Y Cf. A011540, A067251.

%K nonn,base

%O 1,1

%A _Robert Israel_, Dec 22 2023