OFFSET
0,3
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
MAPLE
a:= n-> parse(cat(sort([{convert(n, base, 10)[]}[]], `>`)[])):
seq(a(n), n=0..68); # Alois P. Heinz, Sep 21 2022
MATHEMATICA
f[n_] := FromDigits[Reverse@ Union@ IntegerDigits@ n]; f /@ Range[0, 68] (* Michael De Vlieger, Apr 16 2015, corrected by Robert G. Wilson v *)
PROG
(Haskell)
import Data.List (nub, sort)
a227362 = read . reverse . sort . nub . show :: Integer -> Integer
(PARI) a(n) = {if (n == 0, d = [0], d = digits(n)); eval(subst(Pol(vecsort(d, , 12)), x, 10)); } \\ Michel Marcus, Apr 16 2015
(PARI) a(n)=fromdigits(vecsort(digits(n), , 12)) \\ Charles R Greathouse IV, Apr 16 2015
(Python)
def A227362(n): return int(''.join(sorted(set(str(n)), reverse=True))) # Chai Wah Wu, Nov 23 2022
CROSSREFS
KEYWORD
AUTHOR
Reinhard Zumkeller, Jul 09 2013
STATUS
approved