title: Calculating phi(k) for 1<k<N
body: <p>Given a large N, I need to iterate through all phi(k) such that 1 &lt; k &lt; N :</p>
  
  <ul>
  <li>time-complexity must be <code>O(N logN)</code></li>
  <li>memory-complexity must be sub <code>O(N)</code> (since the values of N will be around 10<sup>12</sup>)</li>
  </ul>
  
  <p>Is it possible? If so, how?</p>