OFFSET
1,2
COMMENTS
a(x0..0) = x, a(x..x) = x..x, x from {1,...,9}.
EXAMPLE
n = 125, S = {125, 152, 215, 251, 512, 521}. The elements 251 and 521 have the smallest number of divisors which equals 2. The smallest from elements 251 and 521 is 251, thus a(125) = 251.
MATHEMATICA
a[n_] := Module[{perm = FromDigits /@ Permutations[IntegerDigits[n]], d}, d = DivisorSigma[0, perm]; Min @ perm[[Position[d, Min[d]] // Flatten]]]; Array[a, 65] (* Amiram Eldar, Apr 27 2021 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ctibor O. Zizka, Apr 27 2021
STATUS
approved