login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A165090 a(n) is the image of n under the base-8 Kaprekar map n -> (n with digits sorted into descending order) - (n with digits sorted into ascending order) 31
0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 7, 14, 21, 28, 35, 42, 14, 7, 0, 7, 14, 21, 28, 35, 21, 14, 7, 0, 7, 14, 21, 28, 28, 21, 14, 7, 0, 7, 14, 21, 35, 28, 21, 14, 7, 0, 7, 14, 42, 35, 28, 21, 14, 7, 0, 7, 49, 42, 35, 28, 21, 14, 7, 0, 63, 63, 126, 189, 252, 315, 378, 441, 63, 0, 63, 126, 189 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,9
LINKS
Indranil Ghosh, Table of n, a(n) for n = 0..32768 (terms 0..4096 from Joseph Myers)
EXAMPLE
For n = 11, 11_10 = 13_8. So, a(11) = 31_8 - 13_8 = 25 - 11 = 14. - Indranil Ghosh, Feb 02 2017
MATHEMATICA
a[n_] := With[{dd = IntegerDigits[n, 8]}, FromDigits[ReverseSort[dd], 8] - FromDigits[Sort[dd], 8]];
a /@ Range[0, 100] (* Jean-François Alcover, Jan 08 2020 *)
PROG
(Python)
def A165090(n):
if n==0:return 0
return int("".join(sorted(oct(n)[2:], reverse=True)), 8)-int("".join(sorted(oct(n)[2:])), 8) # Indranil Ghosh, Feb 02 2017
CROSSREFS
Cf. A165091.
In other bases: A164884 (base 2), A164993 (base 3), A165012 (base 4), A165032 (base 5), A165051 (base 6), A165071 (base 7), A165110 (base 9), A151949 (base 10).
Sequence in context: A096444 A246918 A055957 * A341484 A117013 A176015
KEYWORD
base,nonn
AUTHOR
Joseph Myers, Sep 04 2009
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 13:32 EDT 2024. Contains 371971 sequences. (Running on oeis4.)