>c=i^2+ij-ji-j^2
Thanks for this perspective.
Using ij = (d+n)(x+n) as the mid-point between the large and small squares, went looking for a way to either directly calculate a factor or reduce the iterative search space for finding the solution small square.
Pics attached explore the ij = (d+n)(x+n) "middle" rectangle for various test cases, and includes a square/triangle breakdown for c6107 as an example of how factors could be extracted from this middle area.
The analysis is based on the formulas (DPN - ij) and (ij - XPN), where DPN = (d+n)^2 and XPN = (x+n)^2.
Reason for this approach is that the a[t] values from the na transform (-f,1) and (e,1) starting records are either very close to or an exact match with the (ij - XPN) or (DPN - ij) values. (see c145 as an example).
The "gcd" and "sqrt" columns provide an alterative way to find the solution "a" values and are calculated as:
gcd = gcd(c,(ij - XPN))
sqrt = sqrt((DPN - ij) - (ij - XPN))
Both formulas return the solution "a" value, except for c363 where the gcd result is a^2.
Additional testing has found that the following gcd formulas also work:
a = gcd(c,(ij - XPN))
a = gcd(c,(DPN - ij))
b = gcd(c,(ij + XPN))
b = gcd(c,(DPN + ij))
Furthermore, the sqrt formula (DPN - ij) - (ij - XPN) can be simplified to aa=(d-x)^2. Indicating again the need to find the correct "x" value.
One way to take advantage of these formulas would be to somehow calculate or iterate to the (ij - XPN) value. The last 2 columns using the min_a variable were an attempt to isolate and understand these gaps (2d+1 keeps appearing).
Alternatively, this analysis may lead to an improved iterative search estimated x+n starting position based on the na (e,1) a[t] value.
For c6107, that starting position would be x+n = sqrt(2976) = 54, and reduces the iterative search space by half (see pic attached).