title: All possible combinations of elements
body: <p>I'd like to know a possible algorithm to calculate all possible combinations, without repetitions, starting from length=1 until length=N of N elements.</p>
  
  <p>Example:</p>
  
  <p>Elements: 1, 2, 3.</p>
  
  <p>Output:</p>
  
  <pre>
  1
  2
  3
  12
  13
  23
  123
  </pre>