Maths exam question on consecutive Pythagoras triplets Our 13 year old daughter brought home this maths question that she was asked in a "maths challenge" last week:
Q. The values of the adjacent and opposite sides in a right angle triangle of lengths 3, 4, 5 are consecutive. Obtain another triangle with consecutive adjacent and opposite sides having values between 500 and 1000.
My wife and I spent two hours trying to figure it out before we gave up. The teacher provided the solution (696, 697, 985) but could not explain how to obtain it. Searching on internet we can see solutions to this but none of them that we would expect even a very clever 13 year old to know. Are we missing something obvious?
Thanks,
Adrian
 A: The question, of course, is down to the following. 
Let $a>0$ be a natural number. When is
$$
a^2+(a+1)^2=2a^2+2a+1=b^2
$$
for some other natural number $b$?
The question doesn't seem suitable for school kids, except possibly the very brightest ones, given the fact (that I haven't checked) that the next solution is for $a=696$.
There's a standard way to obtain Pythagorean triples using analytic geometry. In fact Pythagorean triples $(a,b,c)$ are essentially in one-to-one correspondence with points on the circle $C:x^2+y^2=1$ with both coordinates rational. The association is
$$
(a,b,c)\longleftrightarrow\left(\frac ac,\frac bc\right)\in C.
$$
Thus we can parametrize Pythagorean triples systematically, just take the generic line $y=t(x-1)$ through $(1,0)\in C$ and the second point of intersection $P_t$ will have both coordinates in $\Bbb Q$ exactly when $t\in\Bbb Q$. In fact the coordinates of the second intersection point are easily obtained:
$$
P_t=\left(\frac{t^2-1}{t^2+1},\frac{2t}{t^2+1}\right)
$$
(parameter $t$ renormalized so to have the coordinates both positive when $t>0$). Yet doesn't seem to be a trivial task to answer the question using this parametrization.
It's worth noting that the problem would be much easier if we would ask that the difference of length between the hypothenuse and one of the sides be $1$, as in the case $(5,12,13)$.
Indeed one would have to check when
$$
c^2-b^2=(c+b)(c-b)=c+b=2b+1\qquad\qquad\qquad(*)
$$
is a square and that is essentialy a trivial task. For instance one gets in a few seconds of a systematic search the triples $(7,24,25)$, $(9,40,41)$ and so on.
In fact, as even a 13 years old may find soon, just every odd number, not just the squares, is a sum of two consecutive numbers.
A: $x^2+(x+1)^2=y^2 \implies (x+1)^2 = (y+x)(y-x)$
Note that $a=y+x$ and $b=y-x$ gives $x={a-b\over 2}$ and the equation becomes $(a-b+2)^2=4ab$
$2x^2 > 500^2$, $2(x+1)^2 < 1000^2\implies x \geq 354$ and $x \leq 706$ so $1706\geq a\geq 854$ and $646 \geq b\geq 0$
Let $gcd(a,b)=k$ then $(a_1k-b_1k+2)^2=4a_1b_1k^2$ meaning $k^2 \mid (a_1k-b_1k+2)^2$ meaning $k \mid a_1k-b_1k+2$ meaning $k \mid 2$.
($1$) $k=1$ then $(a-b+2)^2=4ab$ where $a,b$ are coprime and are both square numbers.
 $42^2>1706\geq a\geq 854>29^2$ and $26^2>646 \geq b\geq 0$ means there are only $12$ values of $a$ to be checked. Furthermore $a$ cannot be even because if so then $b$ is odd to be coprime with $a$ and the left side becomes odd. So we  only needs to check $6$ values of $a$. 
Expand equation $b^2-2(3a+2)b+(a+2)^2=0$, $\Delta = 32a(a+1)$ is a square number or simply ${a+1\over 2}$ is a square number.
Plug in values $a=31^2,33^2,...,41^2$ and check ${a+1\over 2}$ we get only one pair ($a=41^2, b=17^2$), this correspond to the poster's $x=696$ 
($2$) $k=2$ then $(a_1-b_1+1)^2=16a_1b_1$, thus $a_1, b_1$ are both square numbers. $20^2<427\leq a_1\leq853<30^2, $$b_1 \leq 323<18^2$
Expand equation ${b_1}^2-2(9a_1+1)b_1+(a_1+1)^2=0$, $\Delta = 64a_1(5a_1+1)$ is a square number or simply $5a+1$ is a square number.
This time we have $9$ values of $a_1$ to check from $21$ to $29$. However none of the values produce an integral $b_1$. As a result $x=696$, given by the poster, is the only solution.
A: All Pythagorean triples where $\space B-A=\pm1\space$ can be generated using adjacent $\space (k,m)\space$
Pell numbers
$\big\{0, 1, 2, 5, 12, 29, 70, 169,\cdots\big\}$
and Euclid's formula here shown as
$\quad A=m^2-k^2,\space B=2mk,\space C=m^2+k^2\quad$ and these numbers may be generated using $$m=k+\sqrt{2k^2+(-1)^k}$$
The resulting triples are
\begin{align*}
F(2,1)&=(3,4,5)\\
F(5,2)&=(21,20,29)\\
F(12,5)&=(119,120,169)\\
F(29,12)&=(697,696,985)\\
F(70,29)&=(4059,4060,5741)\\
F(169,70)&=(23661,23660,33461)\\
&\space\vdots
\end{align*}
The process is simpler for adjacent sides $\space(B,C).\space$ In all primitive Pythagorean triples,
$\space C-B=(2x-1)^2, x\in\mathbb{N}\space$ and this is reflected in the formula:
\begin{align*}
A&=(2n-1)^2+&&2(2n-1)k\\ 
B&=         &&2(2n-1)k+2k^2\\
C&=(2n-1)^2+&&2(2n-1)k+2k^2\space
\end{align*}
Using this formula,
$\quad n=1\iff C-B=1\quad$ and the formula reduces to
$$A=2k+1\quad B=2 k^2+2k\quad C=2 k^2 + 2 k + 1$$
which generates
$(3,4,5)\quad( 5,12,13)\quad (7,24,25)\quad (9,40,41)\quad (11,60,61)\quad (13,84,85)\quad\cdots $
