title: printing the sequence in different order
body: <p>I am able to understand the logic here for the below pattern but not getting the way of implementation, please can someone help me here.</p>
  
  <p>The pattern I want is like below, (in first column everything till 5, then second column after 5 leaving first and last row and so on. . )</p>
  
  <pre><code>1 
  2 6 
  3 7 9 
  4 8 
  5
  </code></pre>