login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A346707
"Look once to the left" sequence, omitting a(k) for each iteration k, starting with 1,2 (see example).
0
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,2
COMMENTS
The ratio of number of 2's to number of 1's appears to converge to 1.3985918...
EXAMPLE
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].
MATHEMATICA
Block[{a = {1, 2}}, Do[a = Join[a, Delete[a, i]], {i, 7}]; a] (* Michael De Vlieger, Aug 04 2021 *)
PROG
(Python)
def sequence(iterations, start=[1, 2]):
a = start
for k in range(0, iterations):
a = a + a[:k] + a[k+1:]
return a
(PARI) a(n) = n-=2; while(n>0, my(k=logint(n, 2)); n-=1<<k; if(n<k, n--)); n+2; \\ Kevin Ryde, Aug 03 2021
CROSSREFS
Sequence in context: A319981 A052005 A377902 * A138702 A344339 A348364
KEYWORD
nonn
AUTHOR
Matthew Malone, Jul 29 2021
STATUS
approved