Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $start_time=time();
- $x=array(2);
- $n=200000;
- for($i=3; $i<$n; $i=$i+2)
- {
- $simple=true;
- $cnt = count($x);
- for($j=0; $j<$cnt; $j++)
- {
- if($i%$x[$j]==0)
- {
- $simple=false; break;
- }
- }
- if($simple)
- {
- array_push($x,$i);
- }
- }
- echo("data = ".implode($x, ','));
- echo('
- time = '.(time()-$start_time).' ');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement