OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..32
EXAMPLE
a(3) = 9: {}, 1, 2, 3, 1|2, 2|3, 13, 1|3, 1|2|3.
a(4) = 23: {}, 1, 2, 3, 4, 1|2, 1|3, 13, 1|4, 14, 2|3, 2|4, 24, 3|4, 1|2|3, 1|2|4, 1|24, 14|2, 1|3|4, 13|4, 14|3, 2|3|4, 1|2|3|4.
MAPLE
g:= proc(n, s, t) option remember; `if`(n=0, 1, add(
`if`(j in s, 0, g(n-1, `if`(j=0, {}, s union {j}),
`if`(j=t, t+1, t))), j=0..t))
end:
a:= n-> g(n, {}, 1):
seq(a(n), n=0..20);
MATHEMATICA
g[n_, s_List, t_] := g[n, s, t] = If[n == 0, 1, Sum[If[MemberQ[s, j], 0, g[n-1, If[j == 0, {}, s ~Union~ {j}], If[j == t, t+1, t]]], {j, 0, t}]]; a[n_] := g[n, {}, 1]; Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Feb 04 2017, translated from Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Aug 10 2015
STATUS
approved