Format:
Recent snippets matching tags of euler
# If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. # Find the sum of all the multiples of 3 or 5 below 1000. $target = 999 #first solution (easy) $vals=1..$target $ansA = 0 foreach($v in $vals) { if($v % 3 -eq 0 -or $v % 5 -eq 0) {
231 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
