prime number search implementation in erlang