Oct-01-2020, 11:50 AM
(This post was last modified: Oct-01-2020, 11:50 AM by Gribouillis.)
Here are the increments between two consecutive lines (in the 9x9 case)
Output: 1 2 3 4 5 6 7 8 9
31 31 31 31 31 31 31 31 1
-1 23 23 23 23 23 23 1 1
-1 -1 15 15 15 15 1 1 1
-1 -1 -1 7 7 1 1 1 1
-1 -1 -1 -1 -3 1 1 1 1
-1 -1 -1 -11 -11 -11 1 1 1
-1 -1 -19 -19 -19 -19 -19 1 1
-1 -27 -27 -27 -27 -27 -27 -27 1
This could be the starting point of a non recursive algorithm.