Triangle of partition numbers #
The function PartitionsWithGreatestPart n k counts the number of partitions of n in which
the greatest part is equal to k.
This function generates the triangle:
n\k 1 2 3 4 5 6 7 8
1: 1
2: 1 1
3: 1 1 1
4: 1 2 1 1
5: 1 2 2 1 1
6: 1 3 3 2 1 1
7: 1 3 4 3 2 1 1
8: 1 4 5 5 3 2 1 1
The function TriangleOfPartitions (A008284, offset 1) enumerates the triangle by rows.
@[irreducible]
Partitions of n with greatest part equal to k.
Equations
- PartitionsWithGreatestPart 0 0 = 1
- PartitionsWithGreatestPart 0 k = 0
- PartitionsWithGreatestPart n 0 = 0
- PartitionsWithGreatestPart n_2.succ k_2.succ = PartitionsWithGreatestPart (n_2 - k_2) (k_2 + 1) + PartitionsWithGreatestPart n_2 k_2
Instances For
Triangle PartitionsWithGreatestPart n k enumerated by rows.
Equations
- TriangleOfPartitions n = match TriangleRows (n - 1) with | (k, l) => PartitionsWithGreatestPart (k + 1) (l + 1)
Instances For
OEIS sequence offset