Brute force for 166. Still too slow
Simpler brute force is fast enough.