I can not find out a formula for this :

116 Views Asked by At

Between 1 and 45, (and included, 1 and 45) ;

How many --5 set combinations-- are there from 1 to 45 with a total of 155? *What are these combinations ?

(PS: each number can only be written once )

In Example: 1 + 31 + 34 + 44 + 45 = 155 or 13 + 26 + 35 + 37 + 44 = 155 or 14 + 25 + 35 + 37 + 44 = 155

I am new here, and I could not know which topic belongs to this question...

Thanks.

1

There are 1 best solutions below

12
On

If $\ P(n,m,s)\ $ is the number of partitions of $\ n\ $ with exactly $\ s\ $ unequal summands between $1$ and $\ m\ $, then what you're looking for is $\ P(155,45,5)\ $. I doubt if there's any simple formula for the general value of $\ P(n,m,s)\ $, but once you specify particular values of $\ n\ $, $\ m\ $ and $\ s\ $, you can use the recursion $$ P(n,m,s)=\sum_{i=1}^{\min\left(m,n+1-\frac{s(s-1)}{2}\right)}P(n-i,i-1,s-1) $$ to calculate its value. According to my calculations $\ P(155,45,5)=6557\ $.

Here's a C program to print all $6557$ partitions with the required properties. Only the last $11$ or so lines of output will be visible in the window below the program listing. However, if you click on the clipboard icon in the bar immediately above the output window, all of the output will be copied to your computer's clipboard, from where it can be pasted to a location where all of it will be viewable.