Implemented faster code

After checking out Jason Sundram’s code, I realized that the sieve can
count the number of prime factors, removing the need to factor
non-primes, and making the code much shorter.