OFFSET
0,3
COMMENTS
Rearranging of digits of a(n-1)*n in ascending order gives in step n the smallest number possible. For n >= 5; the number of digits of a(n) < the number of digits of n!.
PROG
(Python)
def A004185(n):
return 0 if n == 0 else int("".join(sorted(str(n))).strip('0'))
def aupton(nn):
alst = [1]
for n in range(1, nn+1): alst.append(A004185(alst[-1]*n))
return alst
print(aupton(29)) # Michael S. Branicky, Jun 29 2021
(PARI) f(n) = fromdigits(vecsort(digits(n))); \\ A004185
a(n) = if (n, f(a(n-1)*n), 1); \\ Michel Marcus, Jun 30 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ctibor O. Zizka, Jun 29 2021
STATUS
approved