Generate integer and set partitions

Generate all ways to write \(n\) as a sum of positive integers (integer partitions). Generate all ways to partition the set \(\{1,2,\ldots,n\}\) into nonempty subsets (set partitions). The number of parts/subsets can be fixed or arbitrary. Output limit is 10.000 objects.
Size \(n\) of the integer/set (max. 20)
Number \(m\) of parts/subsets (between 1 and \(n\))
The algorithms running on this website are part of Jörg Arndt's FXT library. Algorithms for generating integer partitions are described in Algorithms P and H in Knuth's book [Section, Knu11]. An algorithm for generating set partitions is decribed as Algorithm H in Knuth's book [Section, Knu11]. The total number of integer partitions is given by the partition numbers (OEIS sequence A000041), and the total number of set partitions is given by the Bell numbers (OEIS sequence A00110).

Download section

[Zipped C++ source code (GNU GPL)]
[Link to Jörg Arndt's FXT library (GNU GPL)]