problem 10 using the prime checker from 7's solution