Numbers which are not the sum of distinct squares: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Changed to Wren S/H) |
(Added Uiua solution) |
||
Line 1,212: | Line 1,212: | ||
{{out}} |
{{out}} |
||
<pre>2 3 6 7 8 11 12 15 18 19 22 23 24 27 28 31 32 33 43 44 47 48 60 67 72 76 92 96 108 112 128</pre> |
<pre>2 3 6 7 8 11 12 15 18 19 22 23 24 27 28 31 32 33 43 44 47 48 60 67 72 76 92 96 108 112 128</pre> |
||
=={{header|Uiua}}== |
|||
The Wren solution gives a little more justification for my guess... |
|||
<syntaxhighlight lang="Uiua"> |
|||
N ← 16 |
|||
# all sums of the first N squares, sorted and deduped |
|||
◴⊏⊸⍏≡(/+▽)⊙¤⋯⇡÷2ⁿN2×.↘1⇡N |
|||
# find missing numbers |
|||
▽¬°⊚:⇡⊡¯1. |
|||
# After 128 the next thousand can all be generated, so assume that's it done. |
|||
⟜⧻▽≤128. |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
31 |
|||
[2 3 6 7 8 11 12 15 18 19 22 23 24 27 28 31 32 33 43 44 47 48 60 67 72 76 92 96 108 112 128] |
|||
</pre> |
|||
=={{header|Wren}}== |
=={{header|Wren}}== |