Numbers which are not the sum of distinct squares: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (→{{header|Raku}}: clarify slightly) |
Thundergnat (talk | contribs) m (→{{header|Raku}}: more style twiddling) |
||
Line 35: | Line 35: | ||
=={{header|Raku}}== |
=={{header|Raku}}== |
||
[https://tio.run/##jVA7TsMwGN5zik9qhraApS4MjVKxcgZEKwN/wJLjJH4gqip7uQSHYGXrUXqRkD@maUcyWIq/t2uy@rbryi3uXBOkJYcc6@P@C6KU9RLzw3eGCe5NoYzyBEdW9ZyqwB89SYrKYiEEa25WSF2DHcZvAobpnewWz1X5pIz0qjJsILUeTZg6dAglFzh1eVj3do/iQugOP6IniWBUE0i4yvpsVNtg4g9nRq9dcmrCqKiDe5ummxmkeYGhD49gNDkXUdJUumxUqALpBnkeQS@VxhUW/brRasmEFqQd9ddaOs@isxdW5ym8JBuwfuB0hnbIiWcdPF4t1ZjjuP@M1a/5Uc/JXPgfAUnbdb8 Try it online!] |
|||
[https://tio.run/##jVA7TsMwGN5zik9qhpSHpS4MjVKxcgZEKwN/wJLjJH4gqih7uQSHYGXrUXqRYNfUZSSDpfh7uyMtb6ap2eLW9I5rMqiwPuw@wRreLXGx/yoxw52qhRKWYEgLz2lr/NKzrG41FowFzfUKuekxIH0zBJjeSG/x1DaPQnErWhUMuJTJJFCPHVwTCpy63K@93QP7IzT7b@ZJzCnRO2Km1bZMau1U/AmZ0WvITk0CyjpnXot8MwdXz1D0buGUJGMiSpIaUyaFqJFvUFURtFxIXGLh1yWrZSCMIGnIX0tubBCdvbA6TwlLyiPmBxZzjMeceHbO4kVTh8H7HXYfsfx4hcI/bEqPrf@Rko3T9AM Try it online!] |
|||
'''Spoiler:''' ''(highlight to read)''<br> |
'''Spoiler:''' ''(highlight to read)''<br> |
||
Line 48: | Line 48: | ||
if $_ == @run.tail + 1 { @run.push: $_ } else { last if @run.elems > @squares[$sq]; @run = () } |
if $_ == @run.tail + 1 { @run.push: $_ } else { last if @run.elems > @squares[$sq]; @run = () } |
||
} |
} |
||
put grep |
put grep * ∉ @sums, 1..@run.tail and last if @run.elems > @squares[$sq]; |
||
}</lang> |
}</lang> |
||
{{out}} |
{{out}} |