login
Smallest integer k such that k! contains at least n copies of each decimal digit.
1

%I #18 Apr 23 2022 01:40:53

%S 23,34,40,55,59,67,75,81,90,90,97,108,118,123,131,144,147,147,147,157,

%T 157,182,186,186,186,189,203,204,206,206,209,232,232,236,236,237,237,

%U 245,257,257,265,278,282,282,282,282,282,290,307,307,318,318,318,318,341

%N Smallest integer k such that k! contains at least n copies of each decimal digit.

%H Alois P. Heinz, <a href="/A353087/b353087.txt">Table of n, a(n) for n = 1..5000</a>

%e 23! = 25852016738884976640000 is the smallest factorial containing at least one copy of each decimal digit. Thus a(1) = 23.

%p a:= proc(n) option remember; local k; for k from a(n-1)

%p while min((p-> seq(coeff(p, x, j), j=0..9))(add(

%p x^i, i=convert(k!, base, 10))))<n do od; k

%p end: a(0):=0:

%p seq(a(n), n=1..100);

%o (Python)

%o def A353087(n):

%o k, m, r = 1, 1, 10**(10*n-1)

%o while m < r:

%o k += 1

%o m *= k

%o s = str(m)

%o while any(s.count(d) < n for d in '0123456789'):

%o k += 1

%o m *= k

%o s = str(m)

%o return k # _Chai Wah Wu_, Apr 22 2022

%Y Cf. A000142, A352040.

%K nonn,base

%O 1,1

%A _Alois P. Heinz_, Apr 22 2022