login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A165012 a(n) = image of n under the base-4 Kaprekar map n -> (n with digits sorted into descending order) - (n with digits sorted into ascending order) 29
0, 0, 0, 0, 3, 0, 3, 6, 6, 3, 0, 3, 9, 6, 3, 0, 15, 15, 30, 45, 15, 0, 15, 30, 30, 15, 15, 30, 45, 30, 30, 30, 30, 30, 30, 45, 30, 15, 15, 30, 30, 15, 0, 15, 45, 30, 15, 15, 45, 45, 45, 45, 45, 30, 30, 30, 45, 30, 15, 15, 45, 30, 15, 0, 63, 75, 138, 201, 75, 63, 126, 189, 138, 126 (list; graph; refs; listen; history; internal format)
OFFSET

0,5

LINKS

Joseph Myers, Table of n, a(n) for n=0..1024

Index entries for the Kaprekar map

PROG

Contribution from Michael Porter (michael_b_porter(AT)yahoo.com), Nov 05 2009: (Start)

(PARI) cons(m) = {local(b, r); r=0; b=1; for(i=1, matsize(m)[2], r=r+b*m[i]; b=b*4); r}

A165012(n) = {local(m, r); r=[]; m=n; while(m>0, r=concat(m%4, r); m=floor(m/4)); cons(vecsort(r, 0))-cons(vecsort(r, 4))} (End)

CROSSREFS

Cf. A165013.

In other bases: A164884 (base 2), A164993 (base 3), A165032 (base 5), A165051 (base 6), A165071 (base 7), A165090 (base 8), A165110 (base 9), A151949 (base 10).

Sequence in context: A010599 A038517 A055949 * A198126 A074694 A127803

Adjacent sequences:  A165009 A165010 A165011 * A165013 A165014 A165015

KEYWORD

base,nonn

AUTHOR

Joseph Myers (jsm(AT)polyomino.org.uk), Sep 04 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 17 22:48 EST 2012. Contains 206085 sequences.