Edit:
Saw DJR33's post at the same time i posted the below. Will look into what he mentioned for my findprimenumbers and post back here.
Thanks.
Well, its going between 4 and 300. I took what you said and have generated the code below,
Code:
<?php
function IsPrime($number)
{
if ($number < 2) {
return false;
}
for ($i=2; $i<=($number / 2); $i++) {
if($number % $i == 0) {
return false;
}
}
return true;
}
$start = 0;
$end = 300;
$knownprimes = array();
while($start <= $end)
{
$check = IsPrime($start);
if($check == 1)
{
$knownprimes[] = $start;
}
$start++;
}
This puts all known primes into an array knownprimes.
But i guess my biggest issue is how can i search that array for two numbers that equal 4-300?
Bookmarks