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-3 of 3 results.

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)].

A305753 A base-3/2 sorted Fibonacci sequence that starts with a(0) = 0 and a(1) = 1. The terms are interpreted as numbers written in base 3/2. To get a(n+2), add a(n) and a(n+1), write the result in base 3/2 and sort the "digits" into increasing order, omitting all zeros.

Original entry on oeis.org

0, 1, 1, 2, 2, 12, 12, 112, 112, 1112, 1112, 11112, 11112, 111112, 111112, 1111112, 1111112, 11111112, 11111112, 111111112, 111111112, 1111111112, 1111111112, 11111111112, 11111111112, 111111111112, 111111111112, 1111111111112, 1111111111112, 11111111111112, 11111111111112
Offset: 0

Views

Author

Tanya Khovanova and PRIMES STEP Senior group, Jun 09 2018

Keywords

Comments

In base 10, the corresponding sequence is A069638 and is periodic.

Examples

			Write decimal numbers as x_10, base-3/2 numbers as x_b (see A024629).
We have a(1) = 1, a(2) = 2 (in both bases).
Adding, we get 1+2 = 3_10 = 20_b, and sorting the digits gives a(3) = 2_b = 2_10.
Adding 2 and 2 we get 4_10 = 21_b, and sorting the digits gives a(4) = 12_b = (7/2)_10.
Adding 2 and 7/2 we get (11/2)_10 = 201_b, and sorting the digits gives a(5) = 12_b = (7/2)_10.
Adding (7/2)_10 and (7/2)_10 we get 7_10 = 211_b, and sorting the digits gives a(6) = 112_b = (23/4)_10.
Adding (7/2)_10 and (23/4)_10 we get (37/4)_10 = 2011_b, and sorting the digits gives a(7) = 112_b = (23/4)_10.
And so on.
		

Crossrefs

This is A047855 with terms repeated. - N. J. A. Sloane, Jun 19 2018

Programs

  • PARI
    concat(0, Vec(x*(1 - 3*x)*(1 + 3*x) / ((1 - x)*(1 - 10*x^2)) + O(x^40))) \\ Colin Barker, Jun 19 2018

Formula

From Colin Barker, Jun 14 2018: (Start)
Generating function: x*(1 - 3*x)*(1 + 3*x) / ((1 - x)*(1 - 10*x^2)).
a(n) = (10^(n/2) + 80) / 90 for n>0.
a(n) = (10^((n-1)/2) + 8) / 9 for n>0.
a(n) = a(n-1) + 10*a(n-2) - 10*a(n-3) for n>4.
(End)

Extensions

Edited by N. J. A. Sloane, Jun 22 2018

A305880 A base 3/2 reverse sorted Fibonacci sequence that starts with terms 2211 and 2211. The terms are interpreted as numbers written in base 3/2. To get a(n+2), add a(n) and a(n+1), write the result in base 3/2 and sort the digits into decreasing order, omitting all zeros.

Original entry on oeis.org

2211, 2211, 22211, 22211, 222211, 222211, 2222211, 2222211, 22222211, 22222211, 222222211, 222222211, 2222222211, 2222222211, 22222222211, 22222222211, 222222222211, 222222222211, 2222222222211, 2222222222211, 22222222222211, 22222222222211
Offset: 1

Views

Author

Tanya Khovanova and PRIMES STEP Senior group, Jun 13 2018

Keywords

Comments

a(2n-1) and a(2n) consist of n+1 2's followed by 2 1's.
If a reverse sorted Fibonacci sequence starts with any two numbers, then it eventually becomes either cyclic or turns into this sequence.
In base 10, the corresponding sequence is A069638 and is periodic.

Examples

			2211 + 2211 equals 210122 when all numbers are interpreted in base 3/2; after sorting and omitting 0's we obtain a(2) = 22211.
(A305753 has more detailed examples which may help explain the calculations here. - _N. J. A. Sloane_, Jun 22 2018)
		

Crossrefs

Formula

From Colin Barker, Jun 19 2018: (Start)
G.f.: x*(2211 - 2110*x^2) / ((1 - x)*(1 - 10*x^2)).
a(n) = (2^((n+5)/2+3/2) * 5^((n+5)/2+1/2) - 101) / 9 for n even.
a(n) = (2^((n+9)/2) * 5^((n+7)/2) - 101) / 9 for n odd.
a(n) = a(n-1) + 10*a(n-2) - 10*a(n-3) for n>3.
(End)
Showing 1-3 of 3 results.