title: Determine all consecutive subsets of the set {1,2,3,…,n}. The subsets should have at least 2 elements
body: <p>I need to partition a set <code>S={1, 2, 3, … , n}</code> consisting of consecutive numbers such that each subset has has at least 2 elements (rule 1) and it consists of consecutive numbers (rule 2).</p>
  
  <p>The rules are:</p>
  
  <blockquote>
    <ol>
    <li><p>Each subset has at least two elements.</p></li>
    <li><p>All elements of all subsets are consecutive.</p></li>
    <li><p>All elements of S are included in the partition.</p></li>
    </ol>
  </blockquote>
  
  <p>Examples:</p>
  
  <pre><code>There is 1 subset for n = 2: 
  1 2
  There is 1 subset for n = 3:  
  1 2 3   
  There are 2 subset combinations for n = 4:
  1 2 3 4
  1 2 - 3 4
  There are 3 subset combinations for n = 5:
  1 2 3 4 5
  1 2 - 3 4 5
  1 2 3 - 4 5
  There are 5 subset combinations for n = 6:
  1 2 3 4 5 6
  1 2 - 3 4 5 6
  1 2 3 - 4 5 6
  1 2 3 4 - 5 6
  1 2 - 3 4 - 5 6
  There are 8 subset combinations for n = 7:
  1 2 3 4 5 6 7
  1 2 - 3 4 5 6 7
  1 2 3 - 4 5 6 7
  1 2 3 4 - 5 6 7
  1 2 3 4 5 - 6 7
  1 2 - 3 4 - 5 6 7
  1 2 - 3 4 5 - 6 7
  1 2 3 - 4 5 - 6 7
  There are 13 subset combinations for n = 8:
  1 2 3 4 5 6 7 8
  1 2 - 3 4 5 6 7 8
  1 2 3 - 4 5 6 7 8
  1 2 3 4 - 5 6 7 8
  1 2 3 4 5 - 6 7 8
  1 2 3 4 5 6 - 7 8
  1 2 - 3 4 - 5 6 7 8
  1 2 - 3 4 5 - 6 7 8
  1 2 - 3 4 5 6 - 7 8
  1 2 3 - 4 5 - 6 7 8 
  1 2 3 - 4 5 6 - 7 8
  1 2 3 4 - 5 6 - 7 8
  1 2 - 3 4 - 5 6 - 7 8
  There are 21 subset combinations for n = 9:
  1 2 3 4 5 6 7 8 9
  1 2 - 3 4 5 6 7 8 9
  1 2 3 - 4 5 6 7 8 9
  1 2 3 4 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 7 - 8 9 10
  1 2 - 3 4 - 5 6 7 8 - 9 10
  1 2 - 3 4 5 - 6 7 - 8 9 10
  1 2 - 3 4 5 - 6 7 8 - 9 10
  1 2 - 3 4 5 6 - 7 8 - 9 10
  1 2 3 - 4 5 - 6 7 - 8 9 10
  1 2 3 - 4 5 - 6 7 8 - 9 10
  1 2 3 - 4 5 6 - 7 8 - 9 10
  1 2 3 4 - 5 6 - 7 8 - 9 10
  1 2 - 3 4 - 5 6 - 7 8 - 9 10
  </code></pre>
  
  <p>I didn't write them down here but there are 55 subset combinations for n = 11 and 89 subset combinations for n = 12.</p>
  
  <p>I need to write a Visual Basic code listing all possible subset groups for n. I have been thinking on the solution for days but it seems that the solution of the problem is beyond my capacity. The number of required nested loops increases with n and I could not figure out how to program the nested loops with increasing number. Any help will be greatly appreciated. </p>
  
  <p>After some research, I found out this is the problem of "compositions of n with all parts >1" and the total number of possible compositions are Fibonacci numbers (Fn-1 for n).  </p>