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.

A309899 Numbers k = 1, 2, 3, ... are added to the sequence along with k blanks. Next, the numbers k + 1 are inserted on the blanks along with k + 1 blanks. This process is then repeated.

Original entry on oeis.org

1, 2, 2, 3, 4, 3, 3, 5, 6, 4, 4, 4, 7, 8, 5, 5, 9, 5, 5, 10, 6, 6, 11, 12, 6, 6, 6, 7, 7, 13, 14, 8, 7, 7, 15, 8, 7, 7, 16, 9, 17, 8, 8, 18, 9, 10, 8, 8, 8, 19, 20, 9, 9, 11, 10, 21, 22, 9, 9, 12, 9, 9, 10, 10, 23, 11, 24, 13, 25, 10, 10, 11, 26
Offset: 1

Views

Author

Jan Koornstra, Aug 21 2019

Keywords

Examples

			The first elements are:
  1 _ 2 _ _ 3 _ _ _ 4 _ _ _ _ 5 _ _ _ _ _
    2   _ _   3 _ _   _ 4 _ _   _ _ 5 _ _
        3 _     _ _   4   _ _   _ _   5 _
          4     _ _       _ _   5 _     _
                5 _       _ _     _     _
                  .
  1 2 2 3 4 3 3 5 6 4 4 4 7 8 5 5 9 5 5 10
		

Crossrefs

Programs

  • Python
    seq = []
    for n in range(1, 100): seq += [n] + n*[-1]
    for n in range(2, len(seq)):
      value = n
      gaps = 0
      position = n - 1
      while position < len(seq):
        if seq[position] == -1:
          if gaps > 0: gaps -= 1
          else:
            seq[position] = value
            gaps = value
            value += 1
        position += 1
    print(seq)