Problem 5: 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest number that is divisible with no remainder evenly divisible by all of the numbers from 1 to 20?
function modFunction ($mod)While short, this is clearly a brute force approach. Anyone have a more efficient algorithm?
$number = 1
$start = $mod
if($number%$mod -eq 0)
until ($mod -eq 1)