//Super Primes are those primes whose index in the list of primes is the prime itself. (The first superprime is 3)
//The challenge is to find the 142nd superprime.
Here is my code in C#..Prime series generation function is not listed...
ArrayList ar = new ArrayList();
List primes = GeneratePrimesNaive(1000);
for (int j = 0; j < primes.Count; j++)
{
try
{
Application.DoEvents();
lblCounter.Text = (primes[primes[j] - 1]).ToString();
ar.Add(primes[primes[j] - 1]);
}
catch
{
}
}
MessageBox.Show(ar[141].ToString());
Here is my code in C#..Prime series generation function is not listed...
ArrayList ar = new ArrayList();
List
for (int j = 0; j < primes.Count; j++)
{
try
{
Application.DoEvents();
lblCounter.Text = (primes[primes[j] - 1]).ToString();
ar.Add(primes[primes[j] - 1]);
}
catch
{
}
}
MessageBox.Show(ar[141].ToString());
Comments