OFFSET
0,3
FORMULA
a(n) = n * A318191(2,n) for n > 0. - Alois P. Heinz, Jan 09 2019
MAPLE
b:= proc(l) option remember; (n-> `if`(n<2 or max(l[])=0, 1,
add(`if`(l[i]=0 or 1<abs(l[`if`(i=1, 0, i)-1]-l[i]+1)
or 1<abs(l[`if`(i=n, 0, i)+1]-l[i]+1), 0,
b(subsop(i=l[i]-1, l))), i=1..n)))(nops(l))
end:
a:= n-> b([2$n]):
seq(a(n), n=0..12); # Alois P. Heinz, Jan 05 2019
MATHEMATICA
b[l_] := b[l] = With[{n = Length[l]}, If[n < 2 || Max[l ] == 0, 1, Sum[If[ l[[i]] == 0 || 1 < Abs[l[[If[i == 1, 0, i] - 1]] - l[[i]] + 1] || 1 < Abs[l[[If[i == n, 0, i] + 1]] - l[[i]] + 1], 0, b[ReplacePart[l, i -> l[[i]] - 1]]], {i, n}]]];
a[n_] := b[Table[2, {n}]];
a /@ Range[0, 12] (* Jean-François Alcover, May 13 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,walk
AUTHOR
Woong-Gi Jung, Dec 26 2018
EXTENSIONS
More terms from Alois P. Heinz, Dec 30 2018
STATUS
approved