title: Python - get all possible sums of elements inside n 1d arrays
body: <p>Given an integer n, and an array a, I would like to return an array with all the possible values of sums of a with itself n times.</p>
  
  <pre><code>Example: n = 3, a = [1, 2, 3, 4, 5, 6]
  
  Output: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
  </code></pre>
  
  <p>First element is from 1+1+1, second is 1+1+2 etc.</p>
  
  <p>Is there any elegant way to do that? I've tried loops, but since n isn't known in advance, I don't know how many loops I need to make.</p>
  
  <p>Thanks in advance</p>