title: How to calculate parenthesis
body: <p>I want to calculate the <code>coefficients of x^i</code>(and the last number) resulted from calculating <code>(x+i1)*(x+i2)*....*(x+in)</code>, where <code>in</code> is integer.</p>
  
  <p>Having for instance, <code>(x-1)(x-3)=x^2-4x+3</code>, I calculate the coefficients like this:</p>
  
  <pre><code> x^2's is always 1
   x's is i1+i2 
  and the last number is `i1*i2`
  </code></pre>
  
  <p>The problem comes when I have >2 parenthesis. I will get <code>(grade 2 poly)*( grade 1 poly)</code> and the algorithm that I described doesn't work, because there will be 3 coef. in the first parenthesis and my algorithm works only for 2. Basicly, I am looking for a generalization. What algorithm can I use, or is there any Java library or function to use?</p>