OFFSET
1,3
LINKS
EXAMPLE
From Alois P. Heinz, Jul 23 2012: (Start)
a(2) = 1: [1, 3]
[2, 4].
a(3) = 9:
[1, 4, 7] [1, 3, 7] [1, 2, 7] [1, 4, 6] [1, 3, 6]
[2, 5, 8] [2, 5, 8] [3, 5, 8] [2, 5, 8] [2, 5, 8]
[3, 6, 9] [4, 6, 9] [4, 6, 9] [3, 7, 9] [4, 7, 9]
.
[1, 2, 6] [1, 4, 6] [1, 3, 6] [1, 2, 6]
[3, 5, 8] [2, 5, 7] [2, 5, 7] [3, 5, 7]
[4, 7, 9] [3, 8, 9] [4, 8, 9] [4, 8, 9]. (End)
MAPLE
b:= proc(l) option remember; local n; n:= nops(l); `if`({l[]}={0},
1, add(`if`((l[i]-1<>n-i or i=1 or l[i-1]-1<=n-i) and l[i]>
`if`(i=n, 0, l[i+1]), b(subsop(i=l[i]-1, l)), 0), i=1..n))
end:
a:= n-> b([n$n]):
seq(a(n), n=1..8); # Alois P. Heinz, Jul 23 2012
MATHEMATICA
b[l_List] := b[l] = Module[{n = Length[l]}, If[Union[l] == {0}, 1, Sum[If[ (l[[i]]-1 != n-i || i == 1 || l[[i-1]]-1 <= n-i) && l[[i]] > If[i == n, 0, l[[i+1]]], b[ReplacePart[l, i -> l[[i]]-1]], 0], {i, 1, n}]]];
a[n_] := b[Table[n, {n}]];
Array[a, 8] (* Jean-François Alcover, Nov 08 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
One more term from Jud McCranie, Aug 09 2001
a(6)-a(13) from Alois P. Heinz, Jul 23 2012
STATUS
approved