OFFSET
0,3
LINKS
Wikipedia, Partition of a set
EXAMPLE
a(4) = 10: {{1,2,3,4}, {5,6,7,8}, {9,10,11,12}, {13,14,15,16}},
{{1,3,5,7}, {2,4,6,8}, {9,10,11,12}, {13,14,15,16}},
{{1,2,3,4}, {5,7,9,11}, {6,8,10,12}, {13,14,15,16}},
{{1,4,7,10}, {2,5,8,11}, {3,6,9,12}, {13,14,15,16}},
{{1,2,3,4}, {5,6,7,8}, {9,11,13,15}, {10,12,14,16}},
{{1,3,5,7}, {2,4,6,8}, {9,11,13,15}, {10,12,14,16}},
{{2,4,6,8}, {1,5,9,13}, {3,7,11,15}, {10,12,14,16}},
{{1,2,3,4}, {5,8,11,14}, {6,9,12,15}, {7,10,13,16}},
{{1,3,5,7}, {2,6,10,14}, {9,11,13,15}, {4,8,12,16}},
{{1,5,9,13}, {2,6,10,14}, {3,7,11,15}, {4,8,12,16}}.
MAPLE
b:= proc(s, t) option remember; `if`(s={}, 1, (m-> add(
`if`({seq(m-h*j, h=1..3)} minus s={}, b(s minus {seq(m-h*j,
h=0..3)}, t), 0), j=1..min(t, iquo(m-1, 3))))(max(s)))
end:
a:= proc(n) option remember; forget(b): b({$1..4*n}, n) end:
seq(a(n), n=0..12);
MATHEMATICA
b[s_, t_] := b[s, t] = If[s == {}, 1, Function[m, Sum[ If[Union@Table[m-h*j, {h, 1, 3}] ~Complement~ s == {}, b[s ~Complement~ Union@Table[m-h*j, {h, 0, 3}], t], 0], {j, 1, Min[t, Quotient[m-1, 3]]}]][Max[s]]];
a[n_] := a[n] = b[Range[4n], n];
Table[Print[n, " ", a[n]]; a[n], {n, 0, 12}] (* Jean-François Alcover, Feb 13 2023, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Alois P. Heinz, Nov 18 2020
STATUS
approved