Odd and square numbers: Difference between revisions
Content added Content deleted
(J) |
m (→{{header|J}}) |
||
Line 373: | Line 373: | ||
<lang J> (#~ 1=2|]) (#~ (=<.)@%:) 99}. i.1000 |
<lang J> (#~ 1=2|]) (#~ (=<.)@%:) 99}. i.1000 |
||
121 169 225 289 361 441 529 625 729 841 961</lang> |
|||
Or, we could instead have opted to not use filters at all, because the values are their own indices in the initial selection we were working with: |
|||
<lang J> I.((1=2|])*(=<.)@%:*>&99) i.1000 |
|||
121 169 225 289 361 441 529 625 729 841 961</lang> |
121 169 225 289 361 441 529 625 729 841 961</lang> |
||