Before I ask my question let me say I did search for this problem, but I don't have a clue how this would be called - so I'm sorry if this was asked/answered before!
For an audit I have multiple (10) numbers, to make it easy lets say these numbers:
2, 4, 6, 8, 10, 12, 14, 16, 18, 20.
On the other hand I have 2 numbers, that are a sum of the previous numbers - I don't know which numbers and how many numbers would add up to the two numbers. It could be 8&2 numbers or 5&5 numbers..
Is there a simple tool or something to find out which numbers belong to which one? With these numbers I would have multiple combinations that lead to an answer - but how would someone calculate this? Does this have a (mathematical) name?
2 numbers: 50 & 60
eg: 2+6+10+14+18 = 50 & 4+8+12+16+20 = 60 20+18+12 = 50 & 2+4+6+8+10+14+16 = 60 etc
Hope you understand my question/problem ;) Thanks for any advice
P.s. I didn't know which tag to use.
Let's call your $2$ numbers as $x$ and $y$.
From what I understand, of your $10$ other numbers, some subset of them sum to $x$, and the remaining numbers (from your set of $10$) sum to $y$. In this case, it's sufficient for us to find the subset of the $10$ numbers that adds to $x$, because the remaining numbers in our set of $10$ that aren't in this subset will surely sum to $y$.
Our question now becomes, in a set of numbers, how can I find the subset that sum to a certain value ($x$). After looking around a bit on how to do this, I found a post in StackOverflow relating to this "0-1 Knapsack problem". Following those steps, you can find the subset of your $10$ numbers that add to $x$, and the remaining numbers in your set of $10$ will sum to $y$.
Link to StackOverflow question covering how to solve "0-1 Knapsack" problems in Python: https://stackoverflow.com/questions/3420937/algorithm-to-find-which-number-in-a-list-sum-up-to-a-certain-number
Edit: Since you're only dealing with a set of $10$ numbers, it would probably be much easier and sufficiently fast to just brute force it to find which subset sums to $x$. For generating the subsets, you can use the itertools package in Python and loop over r from 1 to 10 (number of elements in the subset), and append them all into a list. Then you can simply go through the list and check each subset to see if the sum equals $x$. Since you only have $10$ numbers, there's only $2^{10} = 1024$ possible subsets, and recent computers can process that in seconds.