lets there is a number (N) and partitions (p), I have all the possible combinations, each combination sums to N. I want to calculate the nth term of these sequences/ combinations given N and p.
N = 7, p = 3
1: 1,1,5
2: 1,2,4
3: 1,3,3
4: 1,4,2
5: 1,5,1
6: 2,1,4
7: 2,2,3
8: 2,3,2
9: 2,4,1
10: 3,1,3
11: 3,2,2
12: 3,3,1
13: 4,1,2
14: 4,2,1
15: 5,1,1
N = 7, p = 4
1: 1,1,1,4
2: 1,1,2,3
3: 1,1,3,2
4: 1,1,4,1
5: 1,2,1,3
6: 1,2,2,2
7: 1,2,3,1
8: 1,3,1,2
9: 1,3,2,1
10: 1,4,1,1
11: 2,1,1,3
12: 2,1,2,2
13: 2,1,3,1
14: 2,2,1,2
15: 2,2,2,1
16: 2,3,1,1
17: 3,1,1,2
18: 3,1,2,1
19: 3,2,1,1
20: 4,1,1,1
N = 7, p = 5
1: 1,1,1,1,3
2: 1,1,1,2,2
3: 1,1,1,3,1
4: 1,1,2,1,2
5: 1,1,2,2,1
6: 1,1,3,1,1
7: 1,2,1,1,2
8: 1,2,1,2,1
9: 1,2,2,1,1
10: 1,3,1,1,1
11: 2,1,1,1,2
12: 2,1,1,2,1
13: 2,1,2,1,1
14: 2,2,1,1,1
15: 3,1,1,1,1