This really belongs with Lucky Spiral. C=: 13 :'1,1++/\4#>:1++2*i.y' C 6 1 3 5 7 9 13 17 21 25 31 37 43 49 57 65 73 81 91 101 111 121 133 145 157 169 D1 C 6 741 D2 C 6 825 (D1 + D2) C 6 1566 (D1 + D2) C 500 669171002
C 6 is the corners of 6 squares around 1 D1 and D2 are the diagonals Linda -----Original Message----- From: [email protected] [mailto:programming-b [email protected]] On Behalf Of Zsbán Ambrus Sent: Monday, March 25, 2013 12:46 PM To: [email protected] Subject: Re: [Jprogramming] Lucky spiral On Thu, Mar 21, 2013 at 9:24 PM, David Ward Lambert <[email protected]> wrote: > cw=:|:@:|. NB. clockwise matrix rotation assert (> 3 0 ; 4 1 ; 5 2) -: > cw i. 2 3 > > spiral =: (, (>:@:(*/) + i.@:}.)@:$)@:cw assert (> 5 4 3 ; 6 1 2 ; 7 8 > 9) -: (spiral^:4)1 1$1 Ah, look! That looks like a new solution to the spiral problem we've dicussed on this mailing list a while ago. See the old thread near http://www.jsoftware.com/pipermail/programming/2007-December/009009.html Ambrus ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
