Change the 2nd while loop in calculateODDPrimes

The loop is set up in a way that it is simpler to use a for loop rather than while loop.