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.

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]