using System.Collections;
using System.Collections.Generic;
public static void Main()
Console.WriteLine("5th prime number is " +
Console.WriteLine("16th prime number is " +
Console.WriteLine("10 001 prime number is " +
static int MAX_SIZE = 10000005;
static ArrayList primes = new ArrayList();
static void SieveOfEratosthenes()
bool[] IsPrime = new bool[MAX_SIZE];
for (int i = 0; i < MAX_SIZE; i++)
for (int p = 2; p * p < MAX_SIZE; p++)
for (int i = p * p; i < MAX_SIZE; i += p)
for (int p = 2; p < MAX_SIZE; p++)