OFFSET
0,10
LINKS
Indranil Ghosh, Table of n, a(n) for n = 0..59049 (terms 0..6561 from Joseph Myers)
EXAMPLE
For n = 11, 11_10 = 12_9. So, a(11) = 21_9 - 12_9 = 19 - 11 = 8. - Indranil Ghosh, Feb 02 2017
MATHEMATICA
a[n_] := With[{dd = IntegerDigits[n, 9]}, FromDigits[ReverseSort[dd], 9] - FromDigits[Sort[dd], 9]];
a /@ Range[0, 100] (* Jean-François Alcover, Jan 08 2020 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Joseph Myers, Sep 04 2009
STATUS
approved