OFFSET
0,3
COMMENTS
A length n inversion sequence e_1e_2...e_n is a sequence of integers such that 0 <= e_i < i. The term a(n) counts the inversion sequences of length n with no entries e_i, e_{i+1}, e_{i+2} such that e_i < e_{i+1} != e_{i+2}. This is the same as the set of inversion sequences of length n avoiding the consecutive patterns 012, 021, 010, 120.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..578
Juan S. Auli and Sergi Elizalde, Consecutive patterns in inversion sequences II: avoiding patterns of relations, arXiv:1906.07365 [math.CO], 2019.
EXAMPLE
The length 4 inversion sequences avoiding the consecutive patterns 012, 021, 010, 120 are 0000, 0110, 0001, 0011, 0111, 0002, 0112, 0022, 0003, 0113.
MAPLE
b:= proc(n, x, t, c) option remember; `if`(n=0, 1, add(`if`(i<x
and t and c=0, 0, b(n-1, i, i<>x, max(0, c-1))), i=1..n))
end:
a:= n-> b(n, 0, false, 2):
seq(a(n), n=0..25); # Alois P. Heinz, Oct 14 2019
MATHEMATICA
b[n_, x_, t_, c_] := b[n, x, t, c] = If[n == 0, 1, Sum[If[i < x && t && c == 0, 0, b[n - 1, i, i != x, Max[0, c - 1]]], {i, 1, n}]];
a[n_] := b[n, 0, False, 2];
a /@ Range[0, 25] (* Jean-François Alcover, Mar 01 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Juan S. Auli, Oct 13 2019
EXTENSIONS
a(11)-a(25) from Alois P. Heinz, Oct 14 2019
STATUS
approved