I have an use case which requires storing and then looking up the integer partitions of numbers. So before I go and actually store all the integer partitions, I am actually trying to check if they are feasible.I have 3 questions associated with it.
Question 1
I am not actually storing all the partitions of the number rather I am storing only those which have 16 parts and maximum element used is 128 . Hence 2048 has 1 partition and everything greater than that has 0 partitions satisfying the constraints. So is there an upper bound or an approximation to find number of such partitions i.e p(n,k,m) which is number of partitions of n into k partitions with maximum partition element used being m?
Question 2
I found out that
p(16,16,128) = 1 which is 1+1+...+1(16 times)
p(2048,16,128) = 1 which is 128+128+...+128(16 times)
p(17,16,128) = 1 which is 1+1+...+2
p(2047,16,128) = 1 which is 128+128+...+127
And I checked for few more and they were similar. As in p(n,k,m) = p(2048-(n-16),k,m) and we could derive the other partition with the one I had. Is this actually true?
Question 3
What is the best algorithm that can be used to generate such integer partitions under constraints? I had seen some code on the internet which does fairly well but it doesn't eliminate the possibilities fast enough i.e for p(2048.16,128) it takes a lot of time even though there is only one such partition.
