OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
a(n) ~ c * 4^n, where c = 0.052940679853652794231561081876002147090052503777... - Vaclav Kotesovec, Feb 23 2014
a(n) = Sum_{k=0..n-1} A356692(n-1,k) for n >= 1. - Alois P. Heinz, Aug 28 2022
EXAMPLE
a(4) = 20 = 4! - 4, because 4 permutations of {1,...,4} do not satisfy the condition: 2314, 2341, 3214, 3241.
MAPLE
b:= proc(u, o) option remember; `if`(u+o=0, 1,
add(b(sort([o-j, u+j-1])[]), j=1..min(2, o))+
add(b(sort([u-j, o+j-1])[]), j=1..min(2, u)))
end:
a:= n-> `if`(n=0, 1, add(b(sort([j-1, n-j])[]), j=1..n)):
seq(a(n), n=0..35);
MATHEMATICA
b[u_, o_] := b[u, o] = If[u+o == 0, 1, Sum[b[Sequence @@ Sort[{o-j, u+j-1}]], {j, 1, Min[2, o]}] + Sum[b[Sequence @@ Sort[{u-j, o+j-1}]], {j, 1, Min[2, u]}]]; a[n_] := If[n == 0, 1, Sum[b[Sequence @@ Sort[{j-1, n-j}]], {j, 1, n}]]; Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Feb 05 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Oct 03 2013
STATUS
approved