cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-8 of 8 results.

A004000 RATS: Reverse Add Then Sort the digits applied to previous term, starting with 1.

Original entry on oeis.org

1, 2, 4, 8, 16, 77, 145, 668, 1345, 6677, 13444, 55778, 133345, 666677, 1333444, 5567777, 12333445, 66666677, 133333444, 556667777, 1233334444, 5566667777, 12333334444, 55666667777, 123333334444, 556666667777, 1233333334444, 5566666667777, 12333333334444
Offset: 1

Views

Author

Keywords

Comments

It is conjectured that no matter what the starting term is, repeatedly applying RATS leads either to this sequence or into a cycle of finite length, such as those in A066710 and A066711.

Examples

			668 -> 668 + 866 = 1534 -> 1345.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a004000_list = iterate a036839 1  -- Reinhard Zumkeller, Mar 14 2012
    
  • Magma
    [ n eq 1 select 1 else Seqint(Reverse(Sort(Intseq(p + Seqint(Reverse(Intseq(p))) where p is Self(n-1))))) : n in [1..10]]; // Sergei Haller (sergei(AT)sergei-haller.de), Dec 21 20061
    
  • Maple
    read transforms; RATS := n -> digsort(n + digrev(n)); b := [1]; t := [1]; for n from 1 to 50 do t := RATS(t); b := [op(b),t]; od: b;
  • Mathematica
    NestList[FromDigits[Sort[IntegerDigits[#+FromDigits[Reverse[ IntegerDigits[#]]]]]]&,1,30] (* Harvey P. Dale, Nov 29 2011 *)
  • PARI
    step(n)=fromdigits(vecsort(digits(n+fromdigits(Vecrev(digits(n)))))) \\ Charles R Greathouse IV, Jun 23 2017
    
  • Python
    l = [0, 1]
    for n in range(2, 51):
        x = str(l[n - 1])
        l.append(int(''.join(sorted(str(int(x) + int(x[::-1]))))))
    print(l[1:]) # Indranil Ghosh, Jul 05 2017

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).
a(n+1) = A036839(a(n)). - Reinhard Zumkeller, Mar 14 2012
A010888(a(n)) = A153130(n-1). - Ivan N. Ianakiev, Nov 27 2014
a(2n-1) = (37 * 10^(n-3) + 3332)/3, n >= 11; a(2n) = (167 * 10^(n-3) + 3331)/3, n >= 10. - Jianing Song, May 06 2021

Extensions

Entry revised by N. J. A. Sloane, Jan 19 2002

A114611 Eventual period of the RATS sequence, where 0 indicates a divergent sequence.

Original entry on oeis.org

0, 0, 8, 0, 0, 8, 0, 0, 2, 0, 0, 8, 0, 0, 8, 0, 0, 2, 0, 0, 8, 0, 0, 8, 0, 0, 2, 0, 18, 8, 0, 0, 8, 0, 0, 2, 0, 18, 8, 0, 0, 8, 0, 0, 2, 0, 18, 8, 18, 0, 8, 0, 0, 2, 0, 18, 8, 18, 0, 8, 0, 0, 2, 0, 18, 8, 18, 0, 2, 0, 0, 2, 0, 18, 8, 18, 0, 2, 0, 0, 2, 0, 18, 8, 18, 0, 2, 0, 0, 2, 0, 18, 8, 18, 0, 2
Offset: 1

Views

Author

Eric W. Weisstein, Dec 16 2005

Keywords

Comments

a(A001651(n)) = 0; a(A114612(n)) = 2; a(A114613(n)) = 3; a(A114614(n)) = 8; a(A114615(n)) = 14; a(A114616(n)) = 18. - Reinhard Zumkeller, Mar 14 2012
Row 10 of A288537. - Andrey Zabolotskiy, Jun 14 2017

Crossrefs

A066711 RATS: Reverse Add Then Sort the digits applied to previous term, starting with 9.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jan 19 2002

Keywords

Comments

a(1) = A114612(1) = 9; A114611(3) = 2. - Reinhard Zumkeller, Mar 14 2012

Examples

			668 -> 668 + 866 = 1534 -> 1345.
		

Crossrefs

Programs

  • Haskell
    a066711_list = iterate a036839 9  -- Reinhard Zumkeller, Mar 14 2012
    
  • 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 *)
  • 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

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

A114613 Starting numbers for which the RATS sequence has eventual period 3.

Original entry on oeis.org

20169, 20709, 21159, 22149, 23139, 24129, 25119, 26109, 27099, 28089, 29079, 30159, 30168, 30708, 30789, 31149, 31158, 31779, 32139, 32148, 32769, 33129, 33138, 33759, 34119, 34128, 34749, 35109, 35118, 35739, 36108, 36729, 37098
Offset: 1

Views

Author

Eric W. Weisstein, Dec 16 2005

Keywords

Comments

A114611(a(n)) = 3. - Reinhard Zumkeller, Mar 14 2012

Crossrefs

A114614 Starting numbers for which the RATS sequence has eventual period 8.

Original entry on oeis.org

3, 6, 12, 15, 21, 24, 30, 33, 39, 42, 48, 51, 57, 60, 66, 75, 84, 93, 102, 105, 111, 123, 129, 132, 138, 141, 147, 150, 159, 165, 168, 174, 177, 183, 186, 192, 195, 201, 204, 210, 219, 222, 228, 231, 237, 240, 246, 249, 258, 264, 267, 273, 276, 282, 285, 291
Offset: 1

Views

Author

Eric W. Weisstein, Dec 16 2005

Keywords

Comments

A114611(a(n)) = 8. - Reinhard Zumkeller, Mar 14 2012

Crossrefs

A114615 Starting numbers for which the RATS sequence has eventual period 14.

Original entry on oeis.org

6999, 7089, 7179, 7269, 7359, 7449, 7539, 7629, 7719, 7809, 7998, 8088, 8178, 8268, 8358, 8448, 8538, 8628, 8718, 8808, 8997, 9087, 9177, 9267, 9357, 9447, 9537, 9627, 9699, 9717, 9789, 9807, 9879, 9969, 9996, 10128, 10167, 10185, 10191
Offset: 1

Views

Author

Eric W. Weisstein, Dec 16 2005

Keywords

Comments

A114611(a(n)) = 14. - Reinhard Zumkeller, Mar 14 2012

Crossrefs

A114616 Starting numbers for which the RATS sequence has eventual period 18.

Original entry on oeis.org

29, 38, 47, 49, 56, 58, 65, 67, 74, 76, 83, 85, 92, 94, 110, 112, 118, 134, 137, 140, 142, 154, 155, 181, 187, 196, 209, 211, 217, 229, 233, 236, 239, 241, 253, 254, 259, 280, 286, 295, 299, 308, 310, 316, 319, 328, 329, 332, 335, 338, 340, 352, 353, 358
Offset: 1

Views

Author

Eric W. Weisstein, Dec 16 2005

Keywords

Comments

A114611(a(n)) = 18. - Reinhard Zumkeller, Mar 14 2012

Crossrefs

A164338 Conway's creeper sequence.

Original entry on oeis.org

12334444, 55667777, 123334444, 556667777, 1233334444, 5566667777, 12333334444, 55666667777, 123333334444, 556666667777, 1233333334444, 5566666667777, 12333333334444, 55666666667777, 123333333334444
Offset: 1

Views

Author

David W. Wilson, Aug 13 2009

Keywords

Comments

Trajectory of 12334444 under the RATS function A036839.
John Conway calls this sequence "the creeper" and conjectures that the RATS trajectory of every n >= 1 eventually enters a cycle or the creeper. David Wilson confirms this conjecture for n <= 10^10.
Continues with the obvious digital pattern.
Since a(n+2) = a(n) except for an added digit, this sequence can be described as a quasi-cycle of period 2 with smallest element 12334444. This is how it is treated in related sequences such as A161590, A161592 and A161593.

Crossrefs

Cf. A036839 (RATS function), A161590, A161592, A161593.

Programs

  • Haskell
    a164338 n = a164338_list !! (n-1)
    a164338_list = iterate a036839 12334444
    -- Reinhard Zumkeller, Mar 14 2012

Formula

a(n+2) = 10 a(n) - 9996 (n odd)
a(n+2) = 10 a(n) - 9993 (n even)
a(n+4) = 11 a(n+2) - 10 a(n)
a(n + 1) = A036839(a(n)). [Reinhard Zumkeller, Mar 14 2012]
G.f.: x*(-55677770*x^3 - 12344440*x^2 + 55667777*x + 12334444)/(10*x^4 - 11*x^2 + 1). - Chai Wah Wu, Feb 08 2020
Showing 1-8 of 8 results.