OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..483
Juan S. Auli and Sergi Elizalde, Consecutive patterns in inversion sequences II: avoiding patterns of relations, arXiv:1906.07365 [math.CO], 2019.
FORMULA
a(n) ~ n! * c * 2^n * n^((Pi+1)/2) / Pi^n, where c = 0.0662002484840446134... - Vaclav Kotesovec, Oct 31 2019
EXAMPLE
a(4) = 17: 0000, 0001, 0002, 0003, 0010, 0011, 0020, 0021, 0022, 0100, 0101, 0102, 0103, 0110, 0111, 0112, 0113.
MAPLE
b:= proc(n, j, t, u, c) option remember; `if`(n=0, 1, add(
`if`(c>0 or i>=j and t or i<=j and u, b(n-1, i,
is(i<=j), is(i>=j), max(0, c-1)), 0), i=1..n))
end:
a:= n-> b(n, 0, true$2, 2):
seq(a(n), n=0..25);
MATHEMATICA
b[n_, j_, t_, u_, c_] := b[n, j, t, u, c] = If[n == 0, 1, Sum[If[c > 0 || i >= j && t || i <= j && u, b[n - 1, i, i <= j, i >= j , Max[0, c - 1]], 0], {i, 1, n}]];
a[n_] := b[n, 0, True, True, 2];
a /@ Range[0, 25] (* Jean-François Alcover, Mar 01 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Oct 17 2019
STATUS
approved