used eratosthenes algorithm