double P = 1.0;
for(int prime in primes) P *= prime/(prime-1.0/prime);
double pi = sqrt(6.0*P);