A036839 RATS(n): Reverse Add Then Sort the digits.
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
Examples
1 -> 1 + 1 = 2, so a(1) = 2; 3 -> 3 + 3 = 6, so a(3) = 6.
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
Programs
-
Haskell
a036839 = a004185 . a056964 -- Reinhard Zumkeller, Mar 14 2012
-
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 *)
-
Python
def A036839(n): x = str(n+int(str(n)[::-1])) return int("".join(sorted(x))) # Indranil Ghosh, Jan 28 2017
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).
Comments