note 104392 deleted from function.gmp-prob-prime by danbrown
| From: | danbrown@php.net | Date: | Mon, 13 Jun 2011 14:11:39 +0000 |
| Subject: | note 104392 deleted from function.gmp-prob-prime by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-180480@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
modified version of roland's code, can go much further than 61
<?php
for ($idx = 0; $idx <= 10000; $idx++) { // this 10000 takes about 3.5 min on 3GHz machine
$pow = gmp_sub(gmp_strval(gmp_pow('2', $idx)), 1); // here is the difference
$prop = gmp_prob_prime($pow);
if ($prop > 0) {
echo 'idx=' . $idx . "\n--------\n";
echo 'pow=' . $pow . "\n";
echo 'prop=' . $prop . "\n------\n";
}
}
?>