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-10 of 18 results. Next

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

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jan 19 2002

Keywords

Comments

a(n) = RATS(n), not RATS(a(n-1)).
Row 10 of A288535. - Andrey Zabolotskiy, Jun 14 2017

Examples

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

Crossrefs

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).
a(n) = A004185(A056964(n)). [Reinhard Zumkeller, Mar 14 2012]

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

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

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

Original entry on oeis.org

3, 6, 12, 33, 66, 123, 444, 888, 1677, 3489, 12333, 44556, 111, 222, 444, 888, 1677, 3489, 12333, 44556, 111, 222, 444, 888, 1677, 3489, 12333, 44556, 111, 222, 444, 888, 1677, 3489, 12333, 44556, 111, 222, 444, 888, 1677, 3489, 12333
Offset: 1

Views

Author

N. J. A. Sloane, Jan 19 2002

Keywords

Comments

a(1) = A114614(1) = 3; A114611(3) = 8. [Reinhard Zumkeller, Mar 14 2012]

Examples

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

Crossrefs

Programs

  • Haskell
    a066710_list = iterate a036839 3  -- Reinhard Zumkeller, Mar 14 2012
  • Mathematica
    f[k_] := Module[{m = FromDigits[Reverse[IntegerDigits[k]]]}, FromDigits[ Sort[ IntegerDigits[k + m]]]]; NestList[f, 3, 50] (* Harvey P. Dale, Jan 18 2011 *)

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 8.
a(n+1) = A036839(a(n)). [Reinhard Zumkeller, Mar 14 2012]
From Chai Wah Wu, Feb 07 2020: (Start)
a(n) = a(n-8) for n > 14.
G.f.: x*(-99*x^13 - 45*x^12 - 44523*x^11 - 12321*x^10 - 3483*x^9 - 1674*x^8 - 888*x^7 - 444*x^6 - 123*x^5 - 66*x^4 - 33*x^3 - 12*x^2 - 6*x - 3)/(x^8 - 1). (End)

A114612 Starting numbers for which the RATS sequence has eventual period 2.

Original entry on oeis.org

9, 18, 27, 36, 45, 54, 63, 69, 72, 78, 81, 87, 90, 96, 99, 108, 114, 117, 120, 126, 135, 144, 153, 156, 162, 171, 180, 189, 198, 207, 213, 216, 225, 234, 243, 252, 255, 261, 270, 279, 288, 297, 306, 312, 315, 324, 333, 342, 351, 354, 360, 369, 378, 387, 396
Offset: 1

Views

Author

Eric W. Weisstein, Dec 16 2005

Keywords

Comments

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

Crossrefs

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

A161593 Lengths of new periods in the RATS sequence (0 replacing infinity).

Original entry on oeis.org

0, 8, 2, 18, 2, 2, 2, 14, 2, 3, 2, 2, 2, 6
Offset: 1

Views

Author

J. H. Conway and Tanya Khovanova, Jun 14 2009

Keywords

Comments

The values A114611(j) for those starting values j of the RATS mapping x->A036839(x) which end in cycles that cannot be reached starting from any smaller j.
Every integer > 1 appears in this sequence. - Andrey Zabolotskiy, Jun 11 2017
For other terms see Branicky link. - Michael S. Branicky, Dec 30 2022

Examples

			a(1)=A114611(0). a(2)=A114611(j=3)=8 with a cycle of length 8 shown in A066710.
A114611(j=6)=8 does not contribute because the cycle is the same as reached from j=3.
a(3)=A114611(9)=2 with a new cycle of length 2 shown in A066711.
A114611(j=12)=8 does not contribute because the cycle is the same as reached from j=3.
A114611(j=15)=8 does not contribute because 15->66->123 is the cycle as reached from j=3.
A114611(j=18)=2 does not contribute because the cycle is the same as reached from j=9.
A114611(j=21)=8 does not contribute because 21->33->66 reaches the same cycle as started from j=3.
a(4)=A114611(j=29)=18.
		

Crossrefs

Extensions

Comment and examples added by R. J. Mathar, Jul 07 2009
a(9)-a(14) from Michael S. Branicky, Dec 30 2022
Showing 1-10 of 18 results. Next