Solve Euler problem #2 in Erlang