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.

A346707 "Look once to the left" sequence, omitting a(k) for each iteration k, starting with 1,2 (see example).

Original entry on oeis.org

1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2
Offset: 1

Views

Author

Matthew Malone, Jul 29 2021

Keywords

Comments

The ratio of number of 2's to number of 1's appears to converge to 1.3985918...

Examples

			Begin with [1, 2].
Iteration 1: append to self, omitting term 1: [1, 2] + [2] = [1, 2, 2].
Iteration 2: append to self, omitting term 2: [1, 2, 2] + [1, 2] = [1, 2, 2, 1, 2].
Iteration 3: append to self, omitting term 3: [1, 2, 2, 1, 2] + [1, 2, 1, 2] = [1, 2, 2, 1, 2, 1, 2, 1, 2].
		

Crossrefs

Programs

  • Mathematica
    Block[{a = {1, 2}}, Do[a = Join[a, Delete[a, i]], {i, 7}]; a] (* Michael De Vlieger, Aug 04 2021 *)
  • PARI
    a(n) = n-=2; while(n>0, my(k=logint(n,2)); n-=1<Kevin Ryde, Aug 03 2021
  • Python
    def sequence(iterations, start=[1,2]):
      a = start
      for k in range(0, iterations):
        a = a + a[:k] + a[k+1:]
      return a