P129, P133: Corrected math.
P112, P129, P133: Added Mathematica solution.