title: Effective way to loop through BigInteger
body: <p>I'm looping through <code>BigInteger</code> like this:</p>
  
  <pre><code>BigInteger i = new BigInteger(Long.MAX_VALUE + "");
      BigInteger end = i.add(new BigInteger("10"));
  
      // Display results
      for (i = new BigInteger(Long.MAX_VALUE + "");
           i.compareTo(end) &lt;= 0;
           i = i.add(new BigInteger("1"))) {
          System.out.println(i.multiply(i));
      }
  </code></pre>
  
  <p>And that's too expensive due memory usage, because of creating new <code>BigInteger</code>  object every loop instead of just increment the value using <code>++</code>.</p>
  
  <p>Is there a way to increment the value instead of creating new object every time?</p>