Sum multiples of 3 and 5: Difference between revisions
Content added Content deleted
(→{{header|Uiua}}: Alternative solution.) |
|||
Line 4,898: | Line 4,898: | ||
IndicesFive ← MultOffive ↘1⇡End |
IndicesFive ← MultOffive ↘1⇡End |
||
/+ |
/+ ◴⊏⊂ Indicesthree IndicesFive ↘1⇡End # join, select and sum |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
233168 |
233168 |
||
</pre> |
</pre> |
||
Alternatively, leaving the 0th element in place means index of n == n, so a simpler solution would be: |
|||
<syntaxhighlight> |
|||
End ← 1000 |
|||
MultOf ← ⊚=0◿ |
|||
/+◴⊂⊃(MultOf3)(MultOf5)⇡End |
|||
</syntaxhighlight> |
|||
=={{header|UNIX Shell}}== |
=={{header|UNIX Shell}}== |