1
edit
Changes
→Assignment 1
=== Assignment 1 ===
* Philip Aziz - Calculating Prime Numbers
Only the inner loop would be possible to Parellelize but would still require to validate 1 prime number at a time due to need to validate against previous prime numbers.
while (count < n){
flag = 1;
i = 1;
checkKey = int((sqrt (prime))+1);
//checks prime numbers for divisible values
while(primes[i] < checkKey and flag){
if ((prime % primes[i])==0){
flag = 0;
}
i++;
}
if(flag){
primes[count] = prime;
count++;
}
prime +=2;
}
{| class="wikitable" border="1"