Hello all, I would like to enquire what is the relationship between spiral number matrices like these :
n=3
1 2 3
8 9 4
7 6 5I do know that there are a lot of solutions for such matrices on the web, but most of them are in C++ and just codes. What I would like to ask is whether it is actually possible to derive a general solution for every line? I came up with a few but as the number grew bigger the general solutions became wrong.n=7
1 2 3 4 5 6 7
24 25 26 27 28 29 8
23 40 41 42 43 30 9
22 39 48 49 44 31 10
21 38 47 46 45 32 11
20 37 36 35 34 33 12
19 18 17 16 15 14 13
Oh, and also, is it actually possible to solve this matrix without using arrays at all?
Thanks