sum of prime numbers in erlang