Brute force for 13, with caching.

I'd have thought this would be faster.