OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..486
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 / (Pi^n * sqrt(n)), where c = 1.0215796642504649172542599982453320786973706265645819484... - Vaclav Kotesovec, Oct 31 2019
EXAMPLE
a(6) = 26: 010101, 010102, 010103, 010104, 010105, 010201, 010202, 010203, 010204, 010205, 010212, 010213, 010214, 010215, 010301, 010302, 010303, 010304, 010305, 010312, 010313, 010314, 010315, 010323, 010324, 010325.
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, Feb 29 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Oct 17 2019
STATUS
approved