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.

A358066 Inventory sequence: record where the 1's, 2's, etc. are located starting with a(1) = 1, a(2) = 1 (see example).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 4, 1, 2, 3, 5, 4, 6, 7, 1, 2, 3, 5, 9, 4, 6, 10, 7, 11, 8, 13, 1, 2, 3, 5, 9, 16, 4, 6, 10, 17, 7, 11, 18, 8, 13, 21, 12, 19, 1, 2, 3, 5, 9, 16, 28, 4, 6, 10, 17, 29, 7, 11, 18, 30, 8, 13, 21, 34, 12, 19, 31, 14, 22, 35, 1, 2, 3, 5, 9, 16, 28, 46, 4, 6, 10, 17, 29, 47, 7, 11, 18, 30, 48
Offset: 1

Views

Author

Ctibor O. Zizka, Oct 29 2022

Keywords

Examples

			At stage n >= 1 we only look at the numbers 1 up to n, and ignore numbers bigger than n.
Stage 0: start with a(1) = 1, a(2) = 1.
Stage 1: we see 1's at 1,2, so we adjoin 1,2, getting 1,1, 1,2.
Stage 2: we see 1's at 1,2,3, and 2's at 4, so we adjoin 1,2,3,4, getting 1,1,1,2, 1,2,3,4.
Stage 3: we see 1's at 1,2,3,5, 2's at 4,6 and 3's at 7, so we adjoin 1,2,3,5,4,6,7, getting 1,1,1,2,1,2,3,4, 1,2,3,5,4,6,7.
Stage 4: we see 1's at 1,2,3,5,9, 2's at 4,6,10, 3's at 7,11, 4's at 8,13, so we adjoin 1,2, ..., 8,13 and so on.
We obtain an irregular triangle by writing the results of the stages as separate rows:
1, 1,
1, 2,
1, 2, 3, 4,
1, 2, 3, 5, 4, 6, 7,
1, 2, 3, 5, 9, 4, 6, 10, 7, 11, 8, 13,
1, 2, 3, 5, 9, 16, 4, 6, 10, 17, 7, 11, 18, 8, 13, 21, 12, 19,
1, 2, 3, 5, 9, 16, 28, 4, 6, 10, 17, 29, 7, 11, 18, 30, 8, 13, 21, 34, 12, 19, 31, 14, 22, 35,
... (_N. J. A. Sloane_, Nov 07 2022)
		

Crossrefs

See A357443 for another version.

Programs

  • Python
    terms = [1, 1]
    for i in range(1,11):
        new_terms = []
        for j in range(1, i+1):
            for k in range(len(terms)):
                if terms[k] == j: new_terms.append(k+1)
        terms.extend(new_terms)
    print(terms) # Gleb Ivanov, Nov 01 2022