Sum multiples of 3 and 5: Difference between revisions
no edit summary
(Added to PowerShell) |
No edit summary |
||
Line 2,326:
integers from 1 ──► 1e84-1 is 233333333333333333333333333333333333333333333333333333333333333333333333333333333333166666666666666666666666666666666666666666666666666666666666666666666666666666666668
</pre>
=={{header|Ring}}==
<lang ring>
see sum35(1000) + nl
func sum35 n
n = n - 1
return(3 * tri(floor(n / 3)) +
5 * tri(floor(n / 5)) -
15 * tri(floor(n / 15)))
func tri n
return n * (n + 1) / 2
</lang>
=={{header|Ruby}}==
|