P71, P76, P123, P173: Added Haskell solution.
P173: Added Mathematica solution, tweaked Java solution.