title: Generate random numbers from 1 to n without duplicate in O(1) space
body: <p>One way is to use an array of size <code>n</code> such that <code>a[i]=i</code>.</p>
  
  <p>Now shuffle it.</p>
  
  <p>Then use a loop to print the numbers. But can it be done without using the array?</p>
  
  <p>Ps: Please do not use any inbuilt Random generator function. I am trying to get a logical answer and write that random function myself.</p>