Project Euler, Problem 12, Mathematica (and binary search by hand)