OFFSET
0,3
COMMENTS
In A337115 the infinite 2D lattice is filled along a square spiral satisfying the same constraint of 2 X 2 squares adding up to squares.
EXAMPLE
The square array starts:
0 1 3 5 8 10 14 18 27 32 ...
2 6 15 26 25 38 19 49 75 ...
4 13 30 29 20 61 51 77 ...
7 12 45 17 34 54 59 ...
9 21 22 37 33 48 ...
11 23 55 82 44 ...
16 31 35 53 ...
24 50 80 ...
28 42 ...
36 ...
...
a(4) is in the second row and column. It must sum up with a(0) = 0, a(1) = 1 and a(2) = 2 to a square, the smallest possible solution is a(4) = 6.
Similarly, a(7) which is on the second row, third column, must sum up with a(1) = 1 (above to the left), a(3) = 3 (above) and a(4) = 6 (to the left) to a square; the smallest solution is a(7) = 15.
PROG
(PARI) A353590_upto(N, M=Map(), r, c, U=[-1])={vector(N, i, if(r && c, my(s=mapget(M, [r-1, c-1])+mapget(M, [r-1, c])+mapget(M, [r, c-1]), m=sqrtint(s)+1); while(setsearch(U, N=m^2-s)||N<=U[1], m+=1); U=setunion(U, [N]), N=U[1]+=1); mapput(M, [r, c], N); if(c, c--; r++, r=!c=r+1); while(#U>2 && U[2]==U[1]+1, U=U[^1]); N)}
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, May 29 2022
STATUS
approved