cp's OEIS Frontend

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.

A165110 a(n) = image of n under the base-9 Kaprekar map n -> (n with digits sorted into descending order) - (n with digits sorted into ascending order).

This page as a plain text file.
%I A165110 #13 Jun 02 2025 02:02:51
%S A165110 0,0,0,0,0,0,0,0,0,8,0,8,16,24,32,40,48,56,16,8,0,8,16,24,32,40,48,24,
%T A165110 16,8,0,8,16,24,32,40,32,24,16,8,0,8,16,24,32,40,32,24,16,8,0,8,16,24,
%U A165110 48,40,32,24,16,8,0,8,16,56,48,40,32,24,16,8,0,8,64,56,48,40,32,24,16,8
%N A165110 a(n) = image of n under the base-9 Kaprekar map n -> (n with digits sorted into descending order) - (n with digits sorted into ascending order).
%H A165110 Indranil Ghosh, <a href="/A165110/b165110.txt">Table of n, a(n) for n = 0..59049</a> (terms 0..6561 from Joseph Myers)
%H A165110 <a href="/index/K#Kaprekar_map">Index entries for the Kaprekar map</a>
%e A165110 For n = 11, 11_10 = 12_9. So, a(11) = 21_9 - 12_9 = 19 - 11 = 8. - _Indranil Ghosh_, Feb 02 2017
%t A165110 a[n_] := With[{dd = IntegerDigits[n, 9]}, FromDigits[ReverseSort[dd], 9] - FromDigits[Sort[dd], 9]];
%t A165110 a /@ Range[0, 100] (* _Jean-François Alcover_, Jan 08 2020 *)
%Y A165110 Cf. A165111.
%Y A165110 In other bases: A164884 (base 2), A164993 (base 3), A165012 (base 4), A165032 (base 5), A165051 (base 6), A165071 (base 7), A165090 (base 8), A151949 (base 10).
%K A165110 base,nonn
%O A165110 0,10
%A A165110 _Joseph Myers_, Sep 04 2009