Solve problem 64 using Erlang.