Writing an integer as a sum of two square in many ways, with consecutive arguments

If $n=x^2+y^2$ holds for some $n,x,y\in\Bbb{N}$, then $n\not\equiv3\pmod4$ as squares are congruent to either $0$ or $1$ modulo $4$. First note that for a nontrivial CMD we must have $n\equiv1\pmod4$:

  • If $n\equiv0\pmod4$ then we must have $x\equiv y\equiv0\pmod{2}$, so there cannot be two consecutive $x_1,x_2\in\Bbb{N}$ with $n=x_1^2+y_1^2=x_2^2+y_2^2$.

  • If $n\equiv2\pmod4$ then we must have $x\equiv y\equiv1\pmod{2}$, so there cannot be two consecutive $x_1,x_2\in\Bbb{N}$ with $n=x_1^2+y_1^2=x_2^2+y_2^2$.

Now let $n=x_i^2+y_i^2$ for a CMD $\{(x_i,y_i)\mid\ i\in\{1,2,3,4\}\}$. Then $x_i\not\equiv y_i\pmod2$ for all $i$, and it is not hard to check that for all $i$ $$x_i\equiv0\pmod4\ \Rightarrow\ n\equiv1\pmod8,$$ $$x_i\equiv1\pmod4\ \Rightarrow\ n\equiv1,5\pmod8,$$ $$x_i\equiv2\pmod4\ \Rightarrow\ n\equiv5\pmod8,$$ $$x_i\equiv3\pmod4\ \Rightarrow\ n\equiv1,5\pmod8,$$ where the odd cases $x_i\equiv1,3\pmod4$ depend on whether $y_i\equiv0\pmod4$ or $y\equiv2\pmod4$. As we have four consecutive $x_i$, we have $n\equiv1\pmod8$ and $n\equiv5\pmod8$, a contradiction. So no CMD of length four (or greater) exists.


Perhaps this helps with your other question, on describing the integers $n$ having a CMD of length $3$:

There is a correspondence between integral points on the quadratic surface $$y^2=2u^2-v^2-2,$$ and length three CMD's. The correspondence is $8$-to-$1$, which comes from the choices of signs for $y$, $u$ and $v$. I don't exclude that some $n\in\Bbb{N}$ might have multiple length three CMD's.

Given a point $(y,u,v)$ on the surface, which is a two-sheeted hyperboloid, set $$x:=\tfrac{1}{2}(y^2-u^2-1)=\tfrac{1}{4}(y^2-v^2-4).$$ Then it is a bit cumbersome to check that the pairs $$\left(|x|,|y|\right),\ \left(|x|+1,|u|\right),\ (|x|+2,|v|),$$ form a CMD of length three. Conversely, given a CMD of length three $(x_1,y_1),\ (x_2,y_2),\ (x_3,y_3)$, it follows from the relations $x_1^2+y_1^2=x_2^2+y_2^2=x_3^2+y_3^2$ that $$y_1^2-2x_1-1=y_2^2\qquad\text{ and }\qquad y_1^2-4x_1-4=y_3^2.$$ Solving both for $x_1$ and equating them shows that $(y_1,y_2,y_3)$ is an integral point on the curve.

The nice thing about quadratic surfaces is that if they have a rational point, then they have infinitely many rational points. Given an explicit point, all rational points can be parametrized explicitly. You've found the point $(y,u,v)=(4,3,0)$ on the surface. This gives us a parametrization by mapping $(\lambda:\mu:\nu)\in\Bbb{P}_{\Bbb{Q}}^2$ to $$\left(4+4\frac{3\mu-2\lambda}{\lambda^2-2\mu^2-\nu^2}\lambda,3+4\frac{3\mu-2\lambda}{\lambda^2-2\mu^2-\nu^2}\mu,4\frac{3\mu-2\lambda}{\lambda^2-2\mu^2-\nu^2}\nu\right),$$ which is undefined only at the points $(3:2:\pm1)\in\Bbb{P}_{\Bbb{Q}}^1$. Then it remains to determine the integral points in this parametrization. We may take $\lambda,\mu,\nu\in\Bbb{Z}$ with $\gcd(\lambda,\mu,\nu)=1$. Then the integral points are the points for which $$\lambda^2-2\mu^2-\nu^2\mid4(3\mu-2\lambda).$$