Erlang version for prime generator