%I #11 May 06 2013 14:54:53
%S 0,0,3,3,3,12,9,35,-2,48,65,72,65,72,73,183,357,500,357,500,480,1250,
%T 2201,2201,-6,4347,4426,4226,9911,13005,20871,22511
%N Location (x,y) of the first n x n square of composite Gaussian integers in the first quadrant.
%C The location of the bottom-left corner of the square is given. We choose the x-coordinate to be as small as possible. The x-coordinate can be negative if the n x n square is centered on the y-axis, as is the case for n = 5 and n = 13. The square is on the line y = x when n = 1, 2, 12, and 14. The Mathematica program prints the minimum (x,y) point and its squared distance from the origin.
%H T. D. Noe, <a href="/A225073/a225073_2.png">Plot of composite squares</a>
%t nn = 1000; offset = 15; z = Table[If[PrimeQ[i + j*I, GaussianIntegers -> True], 1, 0], {i, -offset, nn}, {j, -offset, nn}]; off1 = offset + 1; done = False; sz = 0; While[! done, sz++; mn = Infinity; best = {}; Do[sm = 0; Do[sm = sm + z[[i + ii - 1, j + jj - 1]]; If[sm > 0, Break[]], {ii, sz}, {jj, sz}]; If[sm == 0, d = (i - off1)^2 + (j - off1)^2; If[d <= mn, mn = d; best = {i - off1, j - off1}]], {i, off1 - sz, nn - 1}, {j, i, nn - 1}]; If[mn < Infinity, Print[{Sort[best], mn}], done = True]]
%Y Cf. A225074 (x coordinates), A225075 (y coordinates).
%K sign,more,hard
%O 1,3
%A _T. D. Noe_, May 04 2013
|