Recently, I needed to generate all arithmetic progressions of three distinct perfect squares without any repeats. Mapping $\left(x, y\right)$ to such an arithmetic progression centered at $\left(x^2+y^2\right)^2$ with difference $4xy\left(y^2-x^2\right)$ for all $\left(x,y\right)\in\mathbb{X}$, where $\mathbb{X}:=\left\{\left(x,y\right)\in\mathbb{N}^2:0<x<y\right\}$, should solve this problem, as Fibonacci famously derived in his solution to the Congruum Problem. This means that for such an arithmetic progression $\left(b^2-h, b^2, b^2+h\right)$, there should a unique solution in $\mathbb{X}$ to the system of equations $x^2+y^2=b,4xy\left(y^2-x^2\right)=h$. However, in the case of the progression $\left(205^2,425^2,565^2\right)$, for which $h=138600$, these equations have no solution in $\mathbb{X}$, as can be seen in this Desmos plot. What mistake am I making?
Help with Arithmetic Progressions of Perfect Squares
elementary-number-theoryintegersnumber theoryparametrizationsquare-numbers
Related Solutions
Try these monsters:
$x_{n_1}=\frac{1}{2a}\left[\frac{\gamma_0 \sqrt{P^2-1}+Q\beta_0}{2\sqrt{P^2-1}}\cdot \left(P+\sqrt{P^2-1}\right)^n+ \frac{\gamma_0 \sqrt{P^2-1}-Q\beta_0}{2\sqrt{P^2-1}}\cdot \left(P-\sqrt{P^2-1}\right)^n-b\right]$
and
$x_{n_2}=\frac{1}{2a}\left[\frac{\gamma_0 \sqrt{P^2-1}-Q\beta_0}{2\sqrt{P^2-1}}\cdot \left(P+\sqrt{P^2-1}\right)^n+ \frac{\gamma_0 \sqrt{P^2-1}+Q\beta_0}{2\sqrt{P^2-1}}\cdot \left(P-\sqrt{P^2-1}\right)^n-b\right]$
6 notes:
- $(a,b,c)$ from $f(x)=ax^2+bx+c$
- use minimal $(P,Q)$ such that $P^2-aQ^2=1$
- use minimal $(\gamma_0,\beta_0)$ such that $a\gamma_0^2-\beta_0^2=a(b^2-4ac)$
- for non-square $a$, when a is a square it's analogous to the explanation below
- Reasoning for $x_{n_1}$ and $x_{n_2}$ is that some solutions to $ \ a\gamma^2-\beta^2=a(b^2-4ac) \ $ have two separate strands.
- In using this as written, it may be that you need to take every $ \ n=2m \ $ or $ \ n=2m-1 \ $ or multiples $n=km$ to meet the $\gamma-b \equiv 0 \pmod {2a}$ constraint (referring to how $ \ 2a \cdot x + b = \gamma \ $ below)
The derivation of the above is arriving at the pell equation: $$\begin{align} ax^2 + bx + c &= f(x)=\alpha^2 \\ a(x+b/2a)^2-\frac{b^2-4ac}{4a} &=\alpha^2 \\ a(2ax+b)^2-a(b^2-4ac)&=4a^2\alpha^2=\beta^2 \\ a\gamma^2-\beta^2&=a(b^2-4ac) \end{align}$$ And solving using standard techniques.Thus $$x_n=\frac{\gamma_n-b}{2a}$$ Such that $\gamma_n$ is the nth solution in the above pell type equation : $a\gamma^2-\beta^2=a(b^2-4ac)$
An explanation as to why in your first problem $(2,10,19,47)$ are the only answers is what follows:
The problem at the top has $(a,b,c)=(4,84,-15)$. Since $a$ is square, that pell equation morphs into a difference of two squares.
$$ \begin{align} 4\gamma^2-\beta^2&=29184 \\ (2\gamma)^2-\beta^2&=29184=2^9\cdot3\cdot19 \end{align}$$
Using this identity: $$\left(\frac{d_1+d_2}{2}\right)^2-\left(\frac{d_1-d_2}{2}\right)^2=d_1\cdot d_2$$
Let $d_1, d_2$ be two divisors (of the same parity) of $29184$. You can see here that since there can only be a limited number of divisors of $29184$, even more so limited that have the same parity, you know right here that there's going to be a limited number of solutions.
Let $2\gamma=\frac{d_1+d_2}{2}$, thus $\gamma=\frac{d_1+d_2}{4}$, and finally putting this back into our $x$, and letting $b=84$ and $a=4$, arrive at
$$x=\frac{\left(\frac{d_1+d_2}{4}\right)-84}{8}$$ or $$x=\frac{d_1+d_2-336}{32}=\frac{d_1+d_2}{32}-\frac{21}{2}$$
Now we observe that both factors must add to something directly proportional to 16:
$$d_1+d_2=16\cdot k$$
for the fraction $21/2$ to become whole when added. This implies that both $d_1$ and $d_2$ need to have a factor of atleast $2^4$. The only two-factor sets that come from $2^9\cdot3\cdot19$ and meet this requirement are:
$$\begin{align} (d_1,d_2) &\to x(d_1,d_2) &&\to x=\frac{d_1+d_2}{32}-\frac{21}{2} \\ \cdots \cdots \cdots \cdots \cdots \cdots \\ (3\cdot 19 \cdot 2^4, 2^5) &\to x(912,32) &&\to x=19 \\ (3\cdot 19 \cdot 2^5, 2^4) &\to x(1824,16) &&\to x=47 \\ (3\cdot 2^4,19 \cdot 2^5) &\to x(48,608) &&\to x=10 \\ (3\cdot 2^5,19 \cdot 2^4) &\to x(96,304) &&\to x=2 \\ \end{align}$$
Yes: Green and Tao proved (Theorem 1.2 in their paper; see also this MO answer) not only that the primes contain arbitrarily long arithmetic progressions, but that the same is true of any subset of the primes with positive relative upper density. Primes congruent to $1 \pmod 4$ have relative density $1/2$, so they contain arbitrarily long APs.
Best Answer
You state
and what you found out is that you were wrong. I will try to explain what your error was.
It took me a while to figure out that you were using the mapping $$(x,y) \mapsto (2xy, y^2-x^2, x^2+y^2)$$
to generate Pythagorean triangles. What you have found out is that the above mapping does not generate all Pythagorean triangles.
This is the relationship between Pythagorean triples and arithmetic progressions of three perfect squares
$u^2+w^2=2v^2 \implies a^2+b^2 = c^2 \text{ where } \left\{ \begin{array}{ccl} a &= &\frac 12(w-u)\\ b &= &\frac 12(w+u) \\ c &= &v \end{array}\right.$
$a^2+b^2=c^2 \implies u^2+w^2 = 2v^2 \text{ where } \left\{ \begin{array}{ccl} u &= & b-a\\ v &= & c \\ w &= & b+a \end{array}\right.$
We find that
If we replace $a$ and $b$ with $2st$ and $t^2-s^2$ we get $$h = 4xy(y^2-x^2) \tag{A}$$
which is just what you got; and then you found that you could not solve $4xy(y^2-x^2)=138600$ for $x$ and $y$.
Let's go through the steps that led up to equation (A).
But you discovered that there is no solution to $4xy(y^2-x^2) = 138600$
We found the Pythagorean triangle that corresponds to the arithmetic progression $(205^2, 425^2, 565^2)$, so why can't we solve for $x$ and $y$?
The reason is that the mapping $(x,y) \mapsto (2xy, y^2-x^2, x^2+y^2)$ does not generate all Pythagorean right triangles!
A Pythagorean right triangle, $(a,b,c)$, is called primitive if $\gcd(a,b) =1$.
For example, $(5,12,13)$ is a primitive Pythagorean right triangle and $(9, 12, 15)$ is a Pythagorean right triangle, but it is not primitive since $\gcd(9,12) \ne 1$.
If you require that $\gcd(x,y)=1$ and $x \not \equiv y \pmod 2$ (one of $x$ and $y$ is even and the other is odd), then the mapping $(x,y) \mapsto (2xy, y^2-x^2, x^2+y^2)$ will generate all primitive Pythagorean right triangles.
If you put no restrictions on $x$ and $y$, you will generate other non primitive Pythagorean triangles but you won't generate all of them. For example, $(2xy, y^2-x^2, x^2+y^2) = (12, 9, 15)$ has no solution for $x$ and $y$.
So what you discovered is that $(180, 385, 425)$ is a non primitive Pythagorean triangle that cannot be expressed in the form $(2xy, y^2-x^2, x^2+y^2)$.
ASIDE: The arithmetic progression of squares $(205^2, 425^2, 565^2)$ is not "primitive" either since $\gcd(205, 425, 565) = 5$. Dividing by $5$, we get the primitive triple $(u,v,w)=(41, 85, 113)$, which gives us the primitive Pythagorean triangle $(a,b,c) = (36, 77, 85)$. We then have to solve $4xy(y^2-x^2) = 85^2-41^2= 5544$. We must have $2xy = a = 36$. So $xy=18$. The possible values for $x$ and $y$ are now $(1, 18), (2, 9), (3, 6)$. We also need $y^2-x^2=b=77$. So $(x,y) = (2,9)$. No. This answer cannot be manipulated to solve the original problem.