Odd and square numbers: Difference between revisions

J
(J)
Line 362:
{{out}}
<pre>[121,169,225,289,361,441,529,625,729,841,961]</pre>
 
=={{header|J}}==
 
Example implementation:
 
<lang J> (#~ (1=2|])*(=<.)@%:*>&99) i.1000
121 169 225 289 361 441 529 625 729 841 961</lang>
 
Note that we could have instead used cascading filters (which would be roughly analogous to short circuit operators) for example:
 
<lang J> (#~ 1=2|]) (#~ (=<.)@%:) 99}. i.1000
121 169 225 289 361 441 529 625 729 841 961</lang>
 
=={{header|jq}}==
6,951

edits