More progress
This commit is contained in:
9
solutions/other/multipleof3and5.php
Normal file
9
solutions/other/multipleof3and5.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
//Write a program or solve manually to find the smallest positive number that is evenly divisible by all of the numbers from 1 to 20.
|
||||
$m3 = range(3, 1000, 3);
|
||||
$m5 = range(5, 1000, 5);
|
||||
|
||||
$all = array_unique(array_merge($m3,$m5));
|
||||
|
||||
echo array_sum($all);
|
||||
|
Reference in New Issue
Block a user