OFFSET
1,2
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
FORMULA
a(a(n)) = a(n). - Rémy Sigrist, Oct 22 2020
MATHEMATICA
a[n_] := Module[{p = FromDigits /@ Select[Permutations @ IntegerDigits[n], First[#] > 0 &]}, o = PrimeOmega[p]; Min[p[[Position[o, Min[o]] // Flatten]]]]; Array[a, 100] (* Amiram Eldar, Oct 19 2020 *)
PROG
(PARI) a(n) = {my(d = digits(n), v = select(x->#(digits(x))==#d, vector((#d)!, i, fromdigits(vector(#d, k, d[numtoperm(#d, i-1)[k]])))), b = vecmin(vector(#v, k, bigomega(v[k])))); vecmin(select(x->(bigomega(x)==b), v)); } \\ Michel Marcus, Oct 19 2020
CROSSREFS
KEYWORD
AUTHOR
Roderick Kimball, Sep 30 2020
STATUS
approved