login
A036839
RATS(n): Reverse Add Then Sort the digits.
24
0, 2, 4, 6, 8, 1, 12, 14, 16, 18, 11, 22, 33, 44, 55, 66, 77, 88, 99, 11, 22, 33, 44, 55, 66, 77, 88, 99, 11, 112, 33, 44, 55, 66, 77, 88, 99, 11, 112, 123, 44, 55, 66, 77, 88, 99, 11, 112, 123, 134, 55, 66, 77, 88, 99, 11, 112, 123, 134, 145, 66, 77
OFFSET
0,2
COMMENTS
a(n) = RATS(n), not RATS(a(n-1)).
Row 10 of A288535. - Andrey Zabolotskiy, Jun 14 2017
LINKS
Indranil Ghosh, Table of n, a(n) for n = 0..50000 (terms 0..1000 from T. D. Noe)
R. K. Guy, Conway's RATS and other reversals, Unsolved Problems Column, American Math. Monthly, Vol. 96, pp. 425-428, May 1989.
Eric Weisstein's World of Mathematics, RATS Sequence
FORMULA
Form m by Reversing the digits of n, Add m to n Then Sort the digits of the sum into increasing order to get a(n).
a(n) = A004185(A056964(n)). [Reinhard Zumkeller, Mar 14 2012]
EXAMPLE
1 -> 1 + 1 = 2, so a(1) = 2; 3 -> 3 + 3 = 6, so a(3) = 6.
MAPLE
read transforms; RATS := n -> digsort(n + digrev(n));
MATHEMATICA
FromDigits[Sort[IntegerDigits[#+FromDigits[Reverse [IntegerDigits[#]]]]]] & /@Range[0, 80] (* Harvey P. Dale, Mar 26 2011 *)
PROG
(Haskell)
a036839 = a004185 . a056964 -- Reinhard Zumkeller, Mar 14 2012
(Python)
def A036839(n):
x = str(n+int(str(n)[::-1]))
return int("".join(sorted(x))) # Indranil Ghosh, Jan 28 2017
CROSSREFS
KEYWORD
nonn,base,nice,easy,look
AUTHOR
N. J. A. Sloane, Jan 19 2002
STATUS
approved