Sum multiples of 3 and 5: Difference between revisions
Content added Content deleted
No edit summary |
(added Ol) |
||
Line 2,168: | Line 2,168: | ||
233168 |
233168 |
||
</pre> |
</pre> |
||
=={{header|Ol}}== |
|||
<lang scheme> |
|||
(print |
|||
(fold (lambda (s x) |
|||
(+ s (if (or (zero? (remainder x 3)) (zero? (remainder x 5))) x 0))) |
|||
0 (iota 1000))) |
|||
; ==> 233168 |
|||
</lang> |
|||
=={{header|PARI/GP}}== |
=={{header|PARI/GP}}== |