Finds all partitions of a set, or only those partitions of a specified length. Includes a viewer.
Author: Matt Fig
Very useful function. I made a couple of tweaks.
- I added another "easy case" when N==K to speed up that situation
- I put a "round" at the end of the Stirling function because sometimes I wasn't getting an integer output, for example when I tried stirling(15,15). There may be a better way to handle this than just doing a round.