Solved Problem3 Using Sieve of Eratosthenes