Sieve of eratosthenes method for finding nth prime