Euler/euler05-bis.php

21 lines
362 B
PHP
Raw Normal View History

2015-11-14 23:14:13 +01:00
<?php
/*
* Gnieark's anwser to euler problem 5
* https://projecteuler.net/problem=5
*/
//decrement smaller by 20 and tests
$divisible=false;
$i=0;
while(!$divisible){
$i+=20;
//tester si i est divisible
$divisible=true;
for($j=19;$j>1;$j--){
if(fmod($i,$j)<>0){
$divisible=false;
break;
}
}
}
echo $i;