P62, P77: Revamped Java solution for simplicity and correctness.
P49, P50, P72: Added Mathematica solution.
P133: Vastly sped up Java solution with new math.