(slow) Solution for problem #7

This is a terribly inefficient way to calculate primes, but it works (eventually)