What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

363 views

selected

Solution: To find the smallest positive number run the following code

<?php
$y = 0;$l = 20;
for ($i =$l; !$y;$i += $l) { for ($j = 2; $j <$l; $j++) { if ($i % $j == 0) {$y = 1;
}
else {
$y = 0; break; } } if ($y) {
echo \$i;
break;
}
}

?>