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 23 results. Next

A161590 Initial value x of a RATS trajectory x->A036839(x) ending in a cycle unreachable by any smaller initial value.

Original entry on oeis.org

1, 3, 9, 29, 69, 2079, 3999, 6999, 10677, 20169, 10049598, 20008989, 100014888, 100074268
Offset: 1

Views

Author

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

Keywords

Comments

This is one way of book-keeping of new "destinies" (the smallest element of the cycle that the trajectory ends up in).
The value 1 is a placeholder for all non-cyclic trajectories.
Next terms are respectively <= 10000122228, 20000666679, 2000001113379, 2000001113559, 9999999999999, 100000044444447. See Branicky link for further upper bounds. - Michael S. Branicky, Dec 30 2022

Examples

			The RATS (Reverse Add Then Sort) algorithm applied to 69 produces a sequence 69, 156, 78, 156, 78, ...
Its cycle {156, 78} appears not if the algorithm is started with any number in the range 0 to 68, so 69 is added to the sequence.
		

Crossrefs

Extensions

10677, 20169 from Wouter Meeussen, Jul 04 2009
Definition rephrased by R. J. Mathar, Jul 08 2009
a(11)-a(14) from Michael S. Branicky, Dec 30 2022

A066713 RATS(2^n): Reverse Add the digits of 2^n, Then Sort: a(n) = A036839(2^n).

Original entry on oeis.org

2, 4, 8, 16, 77, 55, 11, 499, 89, 277, 2255, 145, 11, 1111, 44567, 111499, 12299, 1234, 3467, 113467, 677789, 144556, 1222889, 14445667, 4577789, 55669999, 1134899, 11356999, 12237899, 445557799, 1223555555, 11113366, 1122222266
Offset: 0

Views

Author

N. J. A. Sloane, Jan 19 2002

Keywords

Comments

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

Crossrefs

See A004000, A036839 for more information.

Programs

  • Haskell
    a066713 = a036839 . (2 ^)  -- Reinhard Zumkeller, Mar 14 2012
    
  • Python
    def A066713(n):
        m = 2**n
        return int(''.join(sorted(str(m+int(str(m)[::-1]))))) # Chai Wah Wu, Feb 07 2020

A056964 a(n) = n + reversal of digits of n.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 22, 33, 44, 55, 66, 77, 88, 99, 110, 121, 33, 44, 55, 66, 77, 88, 99, 110, 121, 132, 44, 55, 66, 77, 88, 99, 110, 121, 132, 143, 55, 66, 77, 88, 99, 110, 121, 132, 143, 154, 66, 77, 88, 99, 110
Offset: 0

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Comments

If n has an even number of digits then a(n) is a multiple of 11.
Also called the Reverse and Add!, or RADD operation. Iteration of this function leads to the definition of Lychrel and related numbers, cf. A023108, A063048, A088753, A006960, and many others. - M. F. Hasler, Apr 13 2019

Examples

			a(17) = 17 + 71 = 88.
		

Crossrefs

Differs from A052008 when n=101 and a(101)=202 while A052008(101)=121
Cf. A036839.

Programs

Formula

a(n) = n + A004086(n) = 2*n - A056965(n).
n < a(n) < 11n for n > 0. - Charles R Greathouse IV, Nov 17 2022

A009994 Numbers with digits in nondecreasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 33, 34, 35, 36, 37, 38, 39, 44, 45, 46, 47, 48, 49, 55, 56, 57, 58, 59, 66, 67, 68, 69, 77, 78, 79, 88, 89, 99, 111, 112, 113, 114, 115, 116, 117, 118, 119, 122
Offset: 1

Views

Author

Keywords

Comments

Record values and occurrences of A004185. - Reinhard Zumkeller, Dec 05 2009
A193581(a(n)) = 0. - Reinhard Zumkeller, Aug 10 2011
This sequence was used by the U.S. Bureau of the Census in the mid-1950s to numerically code the alphabetical list of counties within a state (with some modifications for Texas). The 3-digit code has a "self-policing element" built into it and "was fairly effective in detecting the transposition of 2 digits." (Hanna 1959). - Randy A. Becker, Dec 11 2017

References

  • Amarnath Murthy and Robert J. Clarke, Some Properties of Staircase sequence, Mathematics & Informatics Quarterly, Volume 11, No. 4, November 2001.
  • Frank A. Hanna, The Compilation of Manufacturing Statistics. U.S. Department of Commerce, Bureau of the Census, 1959.

Crossrefs

Apart from the first term, a subsequence of A052382. A254143 is a subsequence.

Programs

  • Haskell
    import Data.Set (fromList, deleteFindMin, insert)
    a009994 n = a009994_list !! n
    a009994_list = 0 : f (fromList [1..9]) where
       f s = m : f (foldl (flip insert) s' $ map (10*m +) [m `mod` 10 ..9])
             where (m,s') = deleteFindMin s
    -- Reinhard Zumkeller, Aug 10 2011
    
  • Magma
    [k:k in [0..122]|Sort(Intseq(k)) eq Reverse(Intseq(k))]; // Marius A. Burtea, Jul 28 2019
    
  • Maple
    A[0]:= [0]: A[1]:= [$1..9]:
    for d from 2 to 4 do
      A[d]:= map(t -> seq(10*t+i,i=(t mod 10) .. 9), A[d-1]):
    od:
    seq(op(A[d]),d=0..4); # Robert Israel, Jul 28 2019
  • Mathematica
    Select[Range[0, 125], LessEqual@@IntegerDigits[#] &] (* Ray Chandler, Oct 25 2011 *)
  • PARI
    is(n)=n=digits(n);n==vecsort(n) \\ Charles R Greathouse IV, Dec 03 2013
    
  • Python
    from itertools import combinations_with_replacement
    def A009994generator():
        yield 0
        l = 1
        while True:
            for i in combinations_with_replacement('123456789',l):
                yield int(''.join(i))
            l += 1 # Chai Wah Wu, Nov 11 2015
    
  • Scala
    def hasDigitsSorted(n: Int): Boolean = {
      val digSort = Integer.parseInt(n.toString.toCharArray.sorted.mkString)
      n == digSort
    }
    (0 to 200).filter(hasDigitsSorted()) // _Alonso del Arte, Apr 20 2020

Formula

a(n) >> exp(n^(1/10)). - Charles R Greathouse IV, Mar 15 2014
a(n) ~ 10^((9! n)^(1/9) - 5), since 10^(d - 1) <= a(n) < 10^d for binomial(d + 8, 9) < n <= binomial(d + 9, 9) = (d + 5 - epsilon)^9 / 9!. Using epsilon = 10/(3n) + o(1/n) gives more precise estimate. [Following Radcliffe and McKay, cf. SeqFan list.] - M. F. Hasler, Jul 30 2019

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

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

Showing 1-10 of 23 results. Next