OFFSET
1,2
COMMENTS
Take an infinite orthogonal grid of empty cells. Fill one cell with 0. This 0 is now the upper-left corner of an n X n square that must be filled by different integers - one per cell. You are forced to sew your integers one by one on the grid, starting with 1, then 2, then 3, etc. - but in a certain way: start on the 0 and go Up, Right, Down or Left, jumping over 0 cell [this is, put a 1 in a cell that shares a side with the 0-cell (as no diagonal jumps are admitted)]. From there, jump over exactly 1 cell and put a 2 where you land. From there jump over exactly 2 cells and write a 3 where you land (the cell must be free: the cells of the grid are either empty or occupied by a single integer). The general moving rule is thus: from a cell, jump orthogonally over k cells in any direction and write the number k + 1 in that cell. The challenge is to fill the n X n initial square with the smallest possible integers. When the n X n square is filled, the sum of the integers inside the square is a(n).
EXAMPLE
Here is how the 3 X 3 square was filled: start on 0, go to 1, jump to 2, jump to 3, etc. until 16 is reached (a cell is represented by 2 dots).
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. 11 .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .0 .1 16 .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. 10 .8 .6 .. .. .. .. .. .. .7 .9
13 .. .. .. .. .. .. .. .. .. .. .3 .. 12 .2 .4 .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .5 .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
14 .. .. .. .. .. .. .. .. .. .. .. .. .. .. 15 .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
From 0, the successive moves are RDLRDURLRLUDLDRU.
Hence a(3) = 0+1+16+10+8+6+12+2+4 = 59.
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Eric Angelini and Tom Karzes, May 21 2019
STATUS
approved