Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A066711
RATS: Reverse Add Then Sort the digits applied to previous term, starting with 9.
11
9, 18, 99, 189, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117, 288, 117
OFFSET
1,1
COMMENTS
a(1) = A114612(1) = 9; A114611(3) = 2. - Reinhard Zumkeller, Mar 14 2012
LINKS
R. K. Guy, Conway's RATS and other reversals, Amer. Math. Monthly, 96 (1989), 425-428.
J. Thiel, Conway’s RATS Sequences in Base 3, Journal of Integer Sequences, 15 (2012), #12.9.2. - N. J. A. Sloane, Jan 02 2013
Eric Weisstein's World of Mathematics, RATS Sequence
FORMULA
Let a(n) = k, form m by Reversing the digits of k, Add m to k Then Sort the digits of the sum into increasing order to get a(n+1).
Periodic with period 2.
a(n+1) = A036839(a(n)). - Reinhard Zumkeller, Mar 14 2012
G.f.: x*(-99*x^5 - 18*x^4 - 171*x^3 - 90*x^2 - 18*x - 9)/(x^2 - 1). - Chai Wah Wu, Feb 07 2020
EXAMPLE
668 -> 668 + 866 = 1534 -> 1345.
MATHEMATICA
NestList[ FromDigits[ Sort[ IntegerDigits[# + FromDigits[ Reverse[ IntegerDigits[#]]]]]] &, 9, 48] (* Jayanta Basu, Aug 13 2013 *)
Join[{9, 18, 99, 189}, LinearRecurrence[{0, 1}, {117, 288}, 45]] (* Ray Chandler, Aug 25 2015 *)
PROG
(Haskell)
a066711_list = iterate a036839 9 -- Reinhard Zumkeller, Mar 14 2012
(Python)
from itertools import accumulate
def rats(anm1, _):
return int("".join(sorted(str(anm1 + int(str(anm1)[::-1])))))
print(list(accumulate([9]*49, rats))) # Michael S. Branicky, Sep 18 2021
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Jan 19 2002
STATUS
approved