sieve of eratosthenes using tail recursion.
finally haskell.
not sure this is a good implementation or not.