Question: Does Maple Support k-Groupings of Lists?

Groupings([a, b, ..., n], k)

Is there a built-in function in Maple that generates all possible groupings of the elements [a, b, ..., n] taken k at a time?

Example:

Groupings([a,b,c,d], 2)

Expected output:

[[[[a, b], c], d], [a, [[b, c], d]], [[a, [b, c]], d], [a, [b, [c, d]]], [[a, b], [c, d]]]

Please Wait...