GHCJS Version of primes with the courtesy of @luite