code: public static PrimeNumberSieve getInstance() {
          return new PrimeNumberSieve() {
              @Override
              public PSArray<Integer> calcList(int max) {
                  boolean[] prime = new boolean[max + 1];
                  Arrays.fill(prime, true);
                  prime[0] = false;
                  prime[1] = false;
                  for (int i = 2; i <= max; i++)
                      if (prime[i])
                          for (int j = i + i; j <= max; j += i)
                              prime[j] = false;
                  return toArray(max, prime);
              }
          };
      }
docs: Implementation of Sieve of Eratosthenes
  <p>
  http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes