I'm wondering if there is a formula to determine the total amount of numbers which can add to another number. Example: What combination of four numbers adds to four. The answer is 1 + 1 + 1 + 1. So there is only one solution. Of course this grows considerably as numbers get bigger. For a practical test is there a way to calculate the total solutions for four numbers that add to twenty five. If there is how can this be adjusted for larger sets. Like twenty numbers that add to 113.
Find amount of numbers that can sum to a number
1
$\begingroup$
algebra-precalculus
arithmetic
-
1Do you mean integers? Positive integers? We can always find an infinite number of fractions or irrational numbers that add to a given number if we like. – 2017-01-13
-
0Good point @Mnifldz. Yes I mean positive integers. – 2017-01-13
-
2There is a technique called "stars and bars", which can be applied almost immediately to your technique. If you're looking for four positive integers that sum up to (say) $25$, then you are equivalently looking for four non-negative integers that sum up to $21$. (One simply adds $1$ to each of these four non-negative integers to obtain the positive integers that sum up to $25$.) From there, it is a simple formula for the proper binomial coefficient $\binom{24}{3} = \frac{24!}{3!21!}$, where $n! = n \times (n-1) \times (n-2) \times \cdots \times 2 \times 1$ is read "$n$ factorial". – 2017-01-13
-
0(cont'd) Oops, I realized that this assumes you care about the order of the numbers. If you don't, you want the number of partitions, which is different. So: Is $2+1+1+1 = 5$ different from $1+1+1+2 = 5$, or is it the same? – 2017-01-13
-
0Thanks for the info @BrianTung. I'm going to read up on "stars and bars". – 2017-01-13
-
3If you don't care about the order of the numbers, then the count is the number of partitions: https://en.wikipedia.org/wiki/Partition_%28number_theory%29 – 2017-01-13