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.
%I A165071 #13 Jun 02 2025 01:59:47 %S A165071 0,0,0,0,0,0,0,6,0,6,12,18,24,30,12,6,0,6,12,18,24,18,12,6,0,6,12,18, %T A165071 24,18,12,6,0,6,12,30,24,18,12,6,0,6,36,30,24,18,12,6,0,48,48,96,144, %U A165071 192,240,288,48,0,48,96,144,192,240,96,48,48,96,144,192,240,144,96,96,96 %N A165071 a(n) = image of n under the base-7 Kaprekar map n -> (n with digits sorted into descending order) - (n with digits sorted into ascending order). %H A165071 Indranil Ghosh, <a href="/A165071/b165071.txt">Table of n, a(n) for n = 0..16807</a> (terms 0..2401 from Joseph Myers) %H A165071 <a href="/index/K#Kaprekar_map">Index entries for the Kaprekar map</a> %e A165071 For n = 11, 11_10 = 14_7. So, a(11) = 41_7 - 14_7 = 29 - 11 = 18. - _Indranil Ghosh_, Feb 02 2017 %t A165071 a[n_] := With[{dd = IntegerDigits[n, 7]}, FromDigits[ReverseSort[dd], 7] - FromDigits[Sort[dd], 7]]; %t A165071 a /@ Range[0, 100] (* _Jean-François Alcover_, Jan 08 2020 *) %Y A165071 Cf. A165072. %Y A165071 In other bases: A164884 (base 2), A164993 (base 3), A165012 (base 4), A165032 (base 5), A165051 (base 6), A165090 (base 8), A165110 (base 9), A151949 (base 10). %K A165071 base,nonn %O A165071 0,8 %A A165071 _Joseph Myers_, Sep 04 2009