Numbers which are not the sum of distinct squares: Difference between revisions

J
(Created Nim solution.)
(J)
Line 193:
Found 31 in total
</pre>
 
=={{header|J}}==
Code:
<syntaxhighlight lang=J>task=: {{
r=. 'invalid'
lim=. 1
whilst. -.r -: have do.
have=. r
lim=. lim+1
r=. (i.*:lim) -. (#:i.2^lim)+/ .**:i.lim
end.
}}</syntaxhighlight>
 
Result:
 
<syntaxhighlight lang=J> task''
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</syntaxhighlight>
 
=={{header|jq}}==
6,951

edits