Magic squares of odd order: Difference between revisions
J: simplify rank expression
Alextretyak (talk | contribs) (Added 11l) |
(J: simplify rank expression) |
||
Line 1,966:
Based on http://www.jsoftware.com/papers/eem/magicsq.htm
<lang J>ms=: i:@<.@-: |."
In other words, generate a square of counting integers, like this:
Line 1,995:
Or, based on suggestion by Marios Mamzeris on the talk page (which is similar but oriented different -- both rows and columns shifted somewhat):
<lang J>msmm=: 1 + ((|."
Example use:
|