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.

Previous Showing 11-20 of 42 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]

A033860 Sort-then-add sequence: a(n+1) = a(n) + sort(a(n)).

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 55, 110, 121, 233, 466, 932, 1171, 2288, 4576, 9143, 10492, 11741, 22888, 45776, 91453, 104912, 116161, 227327, 449704, 494183, 628672, 855350, 890908, 899807, 978706, 1046495, 1191064, 1302533, 1425868, 2671556, 3927223, 6150602, 6163168
Offset: 1

Views

Author

Keywords

Examples

			After 9143 the next term is 9143 + 1349 = 10492.
		

Crossrefs

Programs

  • Haskell
    a033860 n = a033860_list !! (n-1)
    a033860_list = iterate a070196 1
    -- Reinhard Zumkeller, Apr 03 2015
    
  • Maple
    a:= proc(n) option remember; `if`(n=1, 1, (t->
          t+parse(cat(sort(convert(t, base, 10))[])))(a(n-1)))
        end:
    seq(a(n), n=1..40);  # Alois P. Heinz, Jan 15 2024
  • Mathematica
    NestList[#+FromDigits[Sort[IntegerDigits[#]]]&,1,40] (* Harvey P. Dale, Jul 24 2016 *)
  • Python
    from itertools import islice
    def agen(an=1): # generator of terms
        while True: yield an; an = an + int("".join(sorted(str(an))))
    print(list(islice(agen(), 100))) # Michael S. Branicky, Jan 15 2024

Formula

a(n+1) = A070196(a(n)). - Reinhard Zumkeller, Apr 03 2015

A070196 a(n) = n plus the sorted version of the base-10 digits of n.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 11, 22, 24, 26, 28, 30, 32, 34, 36, 38, 22, 33, 44, 46, 48, 50, 52, 54, 56, 58, 33, 44, 55, 66, 68, 70, 72, 74, 76, 78, 44, 55, 66, 77, 88, 90, 92, 94, 96, 98, 55, 66, 77, 88, 99, 110, 112, 114, 116, 118, 66, 77, 88, 99, 110, 121, 132, 134
Offset: 0

Views

Author

Eric W. Weisstein, Apr 27 2002

Keywords

Crossrefs

Cf. A033862.
Cf. A004185, A033860 (iterated, starting with 1).

Programs

  • Haskell
    a070196 n = n + a004185 n  -- Reinhard Zumkeller, Apr 03 2015
    
  • Maple
    a:= n-> n+parse(cat(sort(convert(n, base, 10))[])):
    seq(a(n), n=0..67);  # Alois P. Heinz, Jan 15 2024
  • Mathematica
    Table[n+FromDigits[Sort[IntegerDigits[n]]],{n,0,70}] (* Harvey P. Dale, Feb 08 2020 *)
  • Python
    def a(n): return n + int("".join(sorted(str(n))))
    print([a(n) for n in range(68)]) # Michael S. Branicky, Jan 15 2024

Formula

a(n) = n + A004185(n). - Reinhard Zumkeller, Apr 03 2015

Extensions

Zero prepended and offset changed by Reinhard Zumkeller, Apr 03 2015

A069638 "Sorted" sum of two previous terms, beginning with 0,1. "Sorted" means to sort the digits of the sum in ascending order.

Original entry on oeis.org

0, 1, 1, 2, 3, 5, 8, 13, 12, 25, 37, 26, 36, 26, 26, 25, 15, 4, 19, 23, 24, 47, 17, 46, 36, 28, 46, 47, 39, 68, 17, 58, 57, 115, 127, 224, 135, 359, 449, 88, 357, 445, 28, 347, 357, 47, 44, 19, 36, 55, 19, 47, 66, 113, 179, 229, 48, 277, 235, 125, 36, 116, 125, 124, 249, 337
Offset: 0

Views

Author

Gil Broussard, Jan 16 2004

Keywords

Comments

The maximum value in this sequence is 667. After the 75th term, the next 120 terms (a(76) - a(195)) repeat as a group infinitely.

Examples

			a(8)=12 because a(7)+a(6)=13+8=21 and the digits of 21 sorted in ascending order = 12.
Also a(17)=4 because a(16)+a(15)=15+25=40 and the digits of 40 sorted in ascending order = 04, or just 4;
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, n, parse(cat(
          sort(convert(a(n-1)+a(n-2), base, 10))[])))
        end:
    seq(a(n), n=0..77);  # Alois P. Heinz, Aug 31 2022
  • Mathematica
    a[0]:=0
    a[1]:=1
    a[n_] := a[n]=FromDigits[Sort[IntegerDigits[a[n-1]+a[n-2]]]] (* Peter J. C. Moses, Feb 08 2014 *)
    nxt[{a_,b_}]:={b,FromDigits[Sort[IntegerDigits[a+b]]]}; NestList[nxt,{0,1},70][[All,1]] (* Harvey P. Dale, Jul 27 2020 *)
  • Python
    a, terms = [0, 1], 66
    [a.append(int("".join(sorted(str(a[-2]+a[-1]))))) for n in range(2, terms)]
    print(a) # Michael S. Branicky, Aug 31 2022

Formula

a(n) = SORT[a(n-1) + a(n-2)].

A321540 3^n with digits rearranged into nondecreasing order.

Original entry on oeis.org

1, 3, 9, 27, 18, 234, 279, 1278, 1566, 13689, 4599, 114777, 113445, 1233459, 2467899, 1344789, 1234467, 11123469, 23447889, 1112246667, 134446788, 12333456, 113356899, 11234477889, 122234456889, 23444678889, 1222345568889, 2445567778899
Offset: 0

Views

Author

N. J. A. Sloane, Nov 19 2018

Keywords

Crossrefs

The following are parallel families: A000079 (2^n), A004094 (2^n reversed), A028909 (2^n sorted up), A028910 (2^n sorted down), A036447 (double and reverse), A057615 (double and sort up), A263451 (double and sort down); A000244 (3^n), A004167 (3^n reversed), A321540 (3^n sorted up), A321539 (3^n sorted down), A163632 (triple and reverse), A321542 (triple and sort up), A321541 (triple and sort down).
Cf. A004185.

Programs

  • Magma
    [Seqint(Reverse(Sort(Intseq(3^n)))):n in [0..35]]; // Vincenzo Librandi, Jan 22 2020
    
  • Mathematica
    Table[FromDigits[Sort[IntegerDigits[3^n]]], {n, 0, 40}] (* Vincenzo Librandi, Jan 22 2020 *)
  • Python
    def A321540(n): return int(''.join(sorted(str(3**n)))) # Chai Wah Wu, Nov 10 2022

Formula

a(n) = A004185(A000244(n)). - Michel Marcus, Nov 10 2022

A052008 a(n) = 'n with digits sorted in ascending order' + 'n with digits sorted in descending order'.

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, 121
Offset: 0

Views

Author

Patrick De Geest, Nov 15 1999

Keywords

Comments

a(n) = A004185(n) + A004186(n). - Reinhard Zumkeller, Jun 07 2015

Examples

			E.g., n = 19 -> 19 + 91 = 110.
		

Crossrefs

Cf. A052009; different from A056964.

Programs

  • Haskell
    a052008 n = a004185 n + a004186 n  -- Reinhard Zumkeller, Jun 07 2015
    
  • Mathematica
    f[n_]:=Module[{sidn=Sort[IntegerDigits[n]]},FromDigits[sidn]+ FromDigits[ Reverse[sidn]]]; Array[f,70,0] (* Harvey P. Dale, Nov 13 2011 *)
  • PARI
    for(n=0,100,D=digits(n);R=Vecrev(D);print1(sum(i=1,#D,10^(i-1)*(D[i]+R[i])),", ")) \\ Derek Orr, Feb 26 2017

A038574 Write n in ternary, sort digits into increasing order.

Original entry on oeis.org

0, 1, 2, 1, 4, 5, 2, 5, 8, 1, 4, 5, 4, 13, 14, 5, 14, 17, 2, 5, 8, 5, 14, 17, 8, 17, 26, 1, 4, 5, 4, 13, 14, 5, 14, 17, 4, 13, 14, 13, 40, 41, 14, 41, 44, 5, 14, 17, 14, 41, 44, 17, 44, 53, 2, 5, 8, 5, 14, 17, 8, 17, 26, 5, 14, 17, 14, 41, 44, 17, 44, 53, 8, 17, 26, 17, 44, 53, 26, 53, 80
Offset: 0

Views

Author

Keywords

Examples

			15 = 120 -> 012 = 5, so a(15)=5.
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[Sort[IntegerDigits[n,3]],3],{n,0,90}] (* Harvey P. Dale, Dec 08 2015 *)

Extensions

More terms from Erich Friedman.

A319652 Write n in 4-ary, sort digits into increasing order.

Original entry on oeis.org

0, 1, 2, 3, 1, 5, 6, 7, 2, 6, 10, 11, 3, 7, 11, 15, 1, 5, 6, 7, 5, 21, 22, 23, 6, 22, 26, 27, 7, 23, 27, 31, 2, 6, 10, 11, 6, 22, 26, 27, 10, 26, 42, 43, 11, 27, 43, 47, 3, 7, 11, 15, 7, 23, 27, 31, 11, 27, 43, 47, 15, 31, 47, 63, 1, 5, 6, 7, 5, 21, 22, 23, 6, 22, 26, 27
Offset: 0

Views

Author

Seiichi Manyama, Sep 25 2018

Keywords

Crossrefs

b-ary: A038573 (b=2), A038574 (b=3), this sequence (b=4), A319653 (b=5), A319654 (b=6), A319655 (b=7), A319656 (b=8), A319657 (b=9), A004185 (b=10).
Cf. A165012.

Programs

  • Maple
    a:= n-> (l-> add(l[-i]*4^(i-1), i=1..nops(l)))(sort(convert(n, base, 4))):
    seq(a(n), n=0..75);  # Alois P. Heinz, Aug 07 2024
  • Mathematica
    Table[FromDigits[Sort[IntegerDigits[n, 4]], 4], {n, 0, 100}] (* Paolo Xausa, Aug 07 2024 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 4)), 4); \\ Michel Marcus, Sep 25 2018
  • Ruby
    def A(k, n)
      (0..n).map{|i| i.to_s(k).split('').sort.join.to_i(k)}
    end
    p A(4, 100)
    

A319653 Write n in 5-ary, sort digits into increasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 1, 6, 7, 8, 9, 2, 7, 12, 13, 14, 3, 8, 13, 18, 19, 4, 9, 14, 19, 24, 1, 6, 7, 8, 9, 6, 31, 32, 33, 34, 7, 32, 37, 38, 39, 8, 33, 38, 43, 44, 9, 34, 39, 44, 49, 2, 7, 12, 13, 14, 7, 32, 37, 38, 39, 12, 37, 62, 63, 64, 13, 38, 63, 68, 69, 14, 39, 64, 69, 74, 3
Offset: 0

Views

Author

Seiichi Manyama, Sep 25 2018

Keywords

Crossrefs

b-ary: A038573 (b=2), A038574 (b=3), A319652 (b=4), this sequence (b=5), A319654 (b=6), A319655 (b=7), A319656 (b=8), A319657 (b=9), A004185 (b=10).

Programs

  • Mathematica
    Table[FromDigits[Sort[IntegerDigits[n,5]],5],{n,0,100}] (* Harvey P. Dale, Feb 29 2024 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 5)), 5); \\ Michel Marcus, Sep 25 2018
  • Ruby
    def A(k, n)
      (0..n).map{|i| i.to_s(k).split('').sort.join.to_i(k)}
    end
    p A(5, 100)
    

A319654 Write n in 6-ary, sort digits into increasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 1, 7, 8, 9, 10, 11, 2, 8, 14, 15, 16, 17, 3, 9, 15, 21, 22, 23, 4, 10, 16, 22, 28, 29, 5, 11, 17, 23, 29, 35, 1, 7, 8, 9, 10, 11, 7, 43, 44, 45, 46, 47, 8, 44, 50, 51, 52, 53, 9, 45, 51, 57, 58, 59, 10, 46, 52, 58, 64, 65, 11, 47, 53, 59, 65, 71, 2, 8
Offset: 0

Views

Author

Seiichi Manyama, Sep 25 2018

Keywords

Crossrefs

b-ary: A038573 (b=2), A038574 (b=3), A319652 (b=4), A319653 (b=5), this sequence (b=6), A319655 (b=7), A319656 (b=8), A319657 (b=9), A004185 (b=10).

Programs

  • Mathematica
    Table[FromDigits[Sort[IntegerDigits[n,6]],6],{n,0,80}] (* Harvey P. Dale, Sep 20 2020 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 6)), 6); \\ Michel Marcus, Sep 25 2018
  • Ruby
    def A(k, n)
      (0..n).map{|i| i.to_s(k).split('').sort.join.to_i(k)}
    end
    p A(6, 100)
    
Previous Showing 11-20 of 42 results. Next