First time here? Check out the FAQ!
answered 4 years ago
Where have you searched!?
sage: for s in SetPartitions([1,2,3,4,5], 3): ....: print(s) {{1, 4, 5}, {2}, {3}} {{1, 5}, {2, 4}, {3}} {{1, 5}, {2}, {3, 4}} ... {{1, 2, 3}, {4}, {5}}