A346707 "Look once to the left" sequence, omitting a(k) for each iteration k, starting with 1,2 (see example).
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
Keywords
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].
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
Comments