A026141 a(n) = (s(n)-s(n-1))/2, where s = A026139.
1, 2, 1, 3, 2, 1, 2, 1, 3, 3, 2, 1, 3, 2, 1, 2, 1, 3, 2, 1, 2, 1, 3, 3, 2, 1, 3, 3, 2, 1, 3, 2, 1, 2, 1, 3, 3, 2, 1, 3, 2, 1, 2, 1, 3, 2, 1, 2, 1, 3, 3, 2, 1, 3, 2, 1, 2, 1, 3, 2, 1, 2, 1, 3, 3, 2, 1, 3, 3, 2, 1, 3, 2, 1, 2, 1, 3, 3, 2, 1, 3, 3, 2, 1, 3, 2, 1, 2, 1, 3, 3, 2, 1, 3, 2, 1
Offset: 2
Keywords
Links
- Michael De Vlieger, Table of n, a(n) for n = 2..10002
- F. M. Dekking, Permutations of N generated by left-right filling algorithms, arXiv:2001.08915 [math.CO], 2020.
Programs
-
Mathematica
Block[{a, r, s, nn = 105}, a[1] = 1; Do[If[! IntegerQ[a[#1]], Set[a[#1], i], Set[a[#2], i]] & @@ {i - #, i + #} &@ Floor[i/2], {i, 4 nn}]; s = TakeWhile[Array[a[#] &, 2 nn], IntegerQ]; Map[(#2 - #1)/2 & @@ # &, Partition[Union@ FoldList[Max, s], 2, 1]]] (* Michael De Vlieger, Aug 27 2021 *)
Extensions
Edited by N. J. A. Sloane, Jan 31 2020
Comments