more Sum of Primes

C, and improve Haskell