Modified Prime Factorize to call sieve() once.