Solve problem 123 using Erlang.
Switch to explicit 64-bit integer type.