Solve problem 99 using Erlang.