login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A165032
a(n) = image of n under the base-5 Kaprekar map n -> (n with digits sorted into descending order) - (n with digits sorted into ascending order)
30
0, 0, 0, 0, 0, 4, 0, 4, 8, 12, 8, 4, 0, 4, 8, 12, 8, 4, 0, 4, 16, 12, 8, 4, 0, 24, 24, 48, 72, 96, 24, 0, 24, 48, 72, 48, 24, 24, 48, 72, 72, 48, 48, 48, 72, 96, 72, 72, 72, 72, 48, 48, 48, 72, 96, 48, 24, 24, 48, 72, 48, 24, 0, 24, 48, 72, 48, 24, 24, 48, 96, 72, 48, 48, 48, 72, 72, 72
OFFSET
0,6
LINKS
Indranil Ghosh, Table of n, a(n) for n = 0..15625 (terms 0..3125 from Joseph Myers)
EXAMPLE
For n = 10, 10_10 = 20_5. So, a(10) = 20_5 - 2_5 = 10 - 2 = 8. - Indranil Ghosh, Feb 02 2017
MATHEMATICA
a[n_] := With[{dd = IntegerDigits[n, 5]}, FromDigits[ReverseSort[dd], 5] - FromDigits[Sort[dd], 5]];
a /@ Range[0, 100] (* Jean-François Alcover, Jan 08 2020 *)
CROSSREFS
Cf. A165033.
In other bases: A164884 (base 2), A164993 (base 3), A165012 (base 4), A165051 (base 6), A165071 (base 7), A165090 (base 8), A165110 (base 9), A151949 (base 10).
Sequence in context: A190103 A176714 A055951 * A345203 A088374 A156732
KEYWORD
base,nonn
AUTHOR
Joseph Myers, Sep 04 2009
STATUS
approved