Magic constant: Difference between revisions

J
m (include other rosettacode magic square tasks in the See also list)
(J)
Line 544:
Same as Wren example.
</pre>
 
=={{header|J}}==
 
Implementation:<lang J>mgc=: 0 1 0 1&p. % 2:</lang>
 
Task examples:<lang J> mgc 3+i.20
15 34 65 111 175 260 369 505 671 870 1105 1379 1695 2056 2465 2925 3439 4010 4641 5335
mgc 1003x
504514015
(#\,.],.mgc) x:(mgc i.3000) I.10^1+i.10
1 3 15
2 6 111
3 13 1105
4 28 10990
5 59 102719
6 126 1000251
7 272 10061960
8 585 100101105
9 1260 1000188630
10 2715 10006439295</lang>
 
=={{header|jq}}==
6,962

edits