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

A309898 For each b = 1, 2, 3, ... numbers k = 1, 2, 3, ... are inserted into the blanks within the sequence along with k * b blanks, skipping existing terms in the sequence.

Original entry on oeis.org

1, 1, 2, 1, 1, 3, 2, 1, 1, 4, 2, 1, 3, 1, 5, 2, 1, 1, 2, 3, 6, 4, 1, 1, 2, 1, 1, 7, 3, 2, 1, 5, 1, 4, 2, 8, 1, 3, 1, 2, 1, 1, 2, 6, 9, 3, 4, 1, 1, 5, 2, 1, 1, 3, 10, 2, 1, 1, 7, 4, 2, 1, 3, 1, 2, 11, 1, 5, 6, 1, 2, 3, 4, 1, 8, 1, 2, 12, 1, 1, 3, 2, 1, 1, 4, 5, 2, 1, 3, 7, 13
Offset: 1

Views

Author

Jan Koornstra, Aug 21 2019

Keywords

Comments

b = 1 for all blanks forms A003602. b = k yields A002260.

Examples

			The first 21 terms are constructed as follows:
  1 _ 2 _ _ 3 _ _ _ 4 _ _ _ _ 5 _ _ _ _ _ .
    1   _ _   2 _ _   _ _ 3 _   _ _ _ _ _ .
        1 _     _ _   2 _   _   _ _ _ _ 3 .
          1     _ _     _   _   2 _ _ _   .
                1 _     _   _     _ _ 2   .
                  1     _   _     _ _     .
                        1   _     _ _     .
                            1     _ _     .
                                  1 _     .
                                    1     .
  1 1 2 1 1 3 2 1 1 4 2 1 3 1 5 2 1 1 2 3 .
		

Crossrefs

Programs

  • Python
    seq = []
    b = 2
    for n in range(1, 100):
      seq += [n] + [-1] * n
    while -1 in seq:
      i = seq.index(-1)
      seq[i] = 1
      k = 2
      blanks = b
      for s in range(i + 1, len(seq)):
        if seq[s] == -1:
          blanks -= 1
          if blanks < 0:
            seq[s] = k
            blanks = k * b
            k += 1
      b += 1
    print(seq)

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)
Showing 1-2 of 2 results.