//find primes [0,n], and output to primes[]
unsigned int findPrime(const unsigned int n, unsigned int * primes)
{
if(n < 2)
return 0;
long long i,j,k;
bool * isPrimes = 0;
isPrimes = malloc((n+1)*sizeof(bool));
if (isPrimes == 0)
return -1;
memset(isPrimes, 0, sizeof(bool) * (n+1));
for (i=2,j=0; i<=n; i++)
{
if (isPri
unsigned int findPrime(const unsigned int n, unsigned int * primes)
{
if(n < 2)
return 0;
long long i,j,k;
bool * isPrimes = 0;
isPrimes = malloc((n+1)*sizeof(bool));
if (isPrimes == 0)
return -1;
memset(isPrimes, 0, sizeof(bool) * (n+1));
for (i=2,j=0; i<=n; i++)
{
if (isPri