Sometimes the elegance of the math is the only thing standing between a brilliant mind and its own frustration.