A225073 Location (x,y) of the first n x n square of composite Gaussian integers in the first quadrant.
0, 0, 3, 3, 3, 12, 9, 35, -2, 48, 65, 72, 65, 72, 73, 183, 357, 500, 357, 500, 480, 1250, 2201, 2201, -6, 4347, 4426, 4226, 9911, 13005, 20871, 22511
Offset: 1
Links
- T. D. Noe, Plot of composite squares
Programs
-
Mathematica
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]]
Comments