Sum multiples of 3 and 5: Difference between revisions
Content added Content deleted
(OCaml: efficient variant) |
|||
Line 3,965: | Line 3,965: | ||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|RPL}}== |
|||
{{works with|Halcyon Calc|4.2.7}} |
|||
≪ → n |
|||
≪ 0 1 3 FOR j |
|||
{ 3 5 -15 } j GET |
|||
n OVER / ABS IP |
|||
DUP 1 + * 2 / * + |
|||
NEXT |
|||
≫ ≫ |
|||
‘SUM35’ STO |
|||
999 SUM35 |
|||
{{out}} |
|||
<pre> |
|||
1: 233168 |
|||
</pre> |
|||
=={{header|Ruby}}== |
=={{header|Ruby}}== |
||
Simple Version (Slow): |
Simple Version (Slow): |