title: Calculate start middle and end of a number
body: <p>I need a start, middle and end value of any given number, it doesn't have to be equally distributed, just needs a bit of logic. Example:</p>
  
  <p><code>var parts = 3;</code></p>
  
  <p>Obviously, I could devide this by 3 and get an even devised result <code>start: 1; middle: 1; end: 1</code>.</p>
  
  <p>However if the user was to put in something like:</p>
  
  <p><code>var parts = 8;</code></p>
  
  <p>In my eyes, the answer would be <code>start: 2; middle: 4; end: 2</code>.</p>
  
  <p>I need to perform a basic task depending on the length of the 'parts' variable.</p>
  
  <p>Example:</p>
  
  <p>I need to calculate the start, middle and end values so I can do something like this. </p>
  
  <pre><code>for (var t=0; t &lt; start; t++){
      console.log('Start');
  }
  for (var t=0; t &lt; middle; t++){
      console.log('Middle');
  }
  for (var t=0; t &lt; end; t++){
      console.log('End');
  }
  </code></pre>
  
  <p>How could I calculate this?</p>