public void makePrimes() {
    for (int x = 2; x < 1000000; x++)
      prime[x] = true;

    for (int x = 2; x < 1000000; x++) {
      if (prime[x]) {
        int sum = 2 * x;
        while (sum < 1000000) {
          prime[sum] = false;
          sum += x;
        }
      }
    }
  }