Solve problem 41 using Erlang.
Improve performance of C++/Python's problem 41.