can a computer take a figure like 43 and break it down to all combinations of numbers that make up that sum?
I may have put this in the wrong place. I was hoping for a way for a computer (hopefully excel can do it) to be able to break down, ALL possible combinations of figures that add up to a 2 digit sum number (1- 99) .. (The two digit number being the answer of the sum of numbers that make it up). Yes, working backwards from the answer. To illustrate further the examples below together with the above examples :
43=15+10+12+1+5 <examples only>
I know that the list can be extensive, that's why I've only used samples to show what I'm trying to achieve and why I need a computer to do the work for me. I apologise for my lack of having the right terminology to explain myself. Thank you for your effort.
2 Answers | Add Yours
I'm not clear on the goal of your question. Is your task a computer programming task for which you are to produce a computer-based solution to the problem for any two digit number? Is it the number theory task of proposing an algorithm that will produce the solution for any two digit number? Or do you just want a tool that will give you all the possibilities for a given two-digit number?
I'm going to try to answer the third because that's the easiest, but I can't immediately think of a way to do it on Excel. Here is a Mathematica solution for 8 (easily adapted to any other number, two-digit or otherwise). It's anything but elegant, but I think it's easier to understand what I've done written this way.
So that I don't have to worry about redundant answers like 13 = 5 + 5 + 3 and 13 = 5 + 3 + 5, I'm just counting how many times the number 5 shows up, and how many times the number 3 shows up, whatever the order, in my first function. I do that by asking Mathematica to record the count of how many times each possible addend appears from 0 to the maximum number of times that addend can fit in whatever is left after accounting for the higher-valued addends. Flatten and Partition are used just to keep from having lists within lists in my output.
Then I wrote a second function to convert the lists of how many times a number appeared in the sum into an actual equation.
Below are the results for the sum of 8. I hope it's clear how to adjust the code for other numbers and that you have access to mathematica on your campus.
yes if you put in the correct way
We’ve answered 318,983 questions. We can answer yours, too.Ask a question