Brute force, problem 38, not working