title: How to calculate all possible numbers that can result from adding, subtracting, or multiplying another list of numbers?
body: <p>My latest hobby project to teach myself to code better by tossing challenges at myself that somehow benefit me.  This algorithm will basically be part of a solver I'm trying to make for a game I play that uses a bunch of simple math.</p>
  
  <p>I have a list of between seven and nine numbers, each can can be any integer from 1-9, repeats are allowed.  So for example: <code>{6,3,8,9,1,3,7}</code></p>
  
  <p>I want to generate a second list of numbers (a set, no repeats here) that is all the possible results you can get by adding, subtracting, or multiplying the original numbers together.  Each number can only be used once unless it appears in the initial list multiple times.</p>
  
  <ul>
  <li>6 (and all the other individual numbers)</li>
  <li>6+3=9 (already have)</li>
  <li>6+8=14</li>
  <li>...all the addition ending with</li>
  <li>6+3+8+9+1+3+7=37</li>
  <li>6-3=3 (already have)</li>
  <li>6-8= -2</li>
  <li>...all the subtraction and then multiplication</li>
  <li>6+3-8 = 1 (probably have by this point, but I need to calculate it anyways)</li>
  <li>...etc. etc. ad nauseum</li>
  </ul>
  
  <p>So I want each number by itself (easy), each number added/sub'd/mult'd to each other (easy), and then every possible combination of adding, sub'ing, and mult'ing.  <em>EDIT: I forgot to mention that for these purposes operation precedence (multiplication before addition/subtraction) isn't important.  The game I'm mimicking processes each operation individually so <code>6+1*7</code> would be 49, not 42.</em></p>
  
  <p>I've read up a little and I'm thinking that trees are going to be a big part of my solution, but I'm kind of at a loss as how to proceed.  I've had an introduction to trees, but I'm not comfortable enough with them to really understand how they may help me.  I will be putting this algorithm into code, most likely Java or a version of C.</p>
  
  <p>As I mentioned, this is a self-improvement project so I don't just need a pre-coded solution, I'm sure <em>someone</em> on GitHub has done exactly this as some point.</p>