This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A343750 #24 Jan 24 2025 13:26:45 %S A343750 1,2,3,4,5,6,7,8,9,1,11,21,13,41,15,61,17,81,19,2,21,22,23,24,25,26, %T A343750 27,82,29,3,13,23,33,43,53,63,37,83,39,4,41,24,43,44,45,46,47,48,49,5, %U A343750 15,25,53,45,55,65,57,58,59,6,61,26,63,46,65 %N A343750 Let S be the set of all numbers that can be obtained by permuting the digits of n (leading zeros can be omitted). Then a(n) is that element of S with the smallest number of divisors. In case of a tie, choose the smallest. %C A343750 a(x0..0) = x, a(x..x) = x..x, x from {1,...,9}. %e A343750 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. %t A343750 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 *) %o A343750 (PARI) a(n) = my(d=digits(n), nb=#d, v=vector(nb!, k, fromdigits(vector(#d, i, d[numtoperm(nb, k)[i]]))), w=apply(numdiv, v)); vecmin(select(x->(numdiv(x)==vecmin(w)), v)); \\ _Michel Marcus_, Jan 24 2025 %Y A343750 Cf. A000005, A272215. %K A343750 nonn,base %O A343750 1,2 %A A343750 _Ctibor O. Zizka_, Apr 27 2021