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.

A165051 a(n) = image of n under the base-6 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 A165051 #13 Jun 02 2025 01:58:14
%S A165051 0,0,0,0,0,0,5,0,5,10,15,20,10,5,0,5,10,15,15,10,5,0,5,10,20,15,10,5,
%T A165051 0,5,25,20,15,10,5,0,35,35,70,105,140,175,35,0,35,70,105,140,70,35,35,
%U A165051 70,105,140,105,70,70,70,105,140,140,105,105,105,105,140,175,140,140,140
%N A165051 a(n) = image of n under the base-6 Kaprekar map n -> (n with digits sorted into descending order) - (n with digits sorted into ascending order).
%H A165051 Indranil Ghosh, <a href="/A165051/b165051.txt">Table of n, a(n) for n = 0..46656</a> (terms 0..1296 from Joseph Myers)
%H A165051 <a href="/index/K#Kaprekar_map">Index entries for the Kaprekar map</a>
%e A165051 For n = 10, 10_10 = 14_6. So, a(10) = 41_6 - 14_6 = 25 - 10 = 15. - _Indranil Ghosh_, Feb 02 2017
%t A165051 a[n_] := With[{dd = IntegerDigits[n, 6]}, FromDigits[ReverseSort[dd], 6] - FromDigits[Sort[dd], 6]];
%t A165051 a /@ Range[0, 100] (* _Jean-François Alcover_, Jan 08 2020 *)
%Y A165051 Cf. A165052.
%Y A165051 In other bases: A164884 (base 2), A164993 (base 3), A165012 (base 4), A165032 (base 5), A165071 (base 7), A165090 (base 8), A165110 (base 9), A151949 (base 10).
%K A165051 base,nonn
%O A165051 0,7
%A A165051 _Joseph Myers_, Sep 04 2009