login
RATS(n): Reverse Add Then Sort the digits.
24

%I #48 Mar 23 2020 02:41:21

%S 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,

%T 77,88,99,11,112,33,44,55,66,77,88,99,11,112,123,44,55,66,77,88,99,11,

%U 112,123,134,55,66,77,88,99,11,112,123,134,145,66,77

%N RATS(n): Reverse Add Then Sort the digits.

%C a(n) = RATS(n), not RATS(a(n-1)).

%C Row 10 of A288535. - _Andrey Zabolotskiy_, Jun 14 2017

%H Indranil Ghosh, <a href="/A036839/b036839.txt">Table of n, a(n) for n = 0..50000</a> (terms 0..1000 from T. D. Noe)

%H R. K. Guy, <a href="http://www.jstor.org/stable/2325149">Conway's RATS and other reversals</a>, Unsolved Problems Column, American Math. Monthly, Vol. 96, pp. 425-428, May 1989.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/RATSSequence.html">RATS Sequence</a>

%F 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).

%F a(n) = A004185(A056964(n)). [_Reinhard Zumkeller_, Mar 14 2012]

%e 1 -> 1 + 1 = 2, so a(1) = 2; 3 -> 3 + 3 = 6, so a(3) = 6.

%p read transforms; RATS := n -> digsort(n + digrev(n));

%t FromDigits[Sort[IntegerDigits[#+FromDigits[Reverse [IntegerDigits[#]]]]]] & /@Range[0,80] (* _Harvey P. Dale_, Mar 26 2011 *)

%o (Haskell)

%o a036839 = a004185 . a056964 -- _Reinhard Zumkeller_, Mar 14 2012

%o (Python)

%o def A036839(n):

%o x = str(n+int(str(n)[::-1]))

%o return int("".join(sorted(x))) # _Indranil Ghosh_, Jan 28 2017

%Y Cf. A004000, A004185, A288535.

%Y Cf. A161593, A114611, A009994, A004086.

%K nonn,base,nice,easy,look

%O 0,2

%A _N. J. A. Sloane_, Jan 19 2002