I am asked to find a primitive Pythagorean triple $(x, y, z)$ such that $x^{2}+y^{2}=z^{2}$ and $|x-y|=1$, and $x\geq100$ and $y\geq 100$.

I know the result should be x = 119, y = 120 and z = 169, but I don't know how to "find" it systematically. By the theorem, we can have




I am stuck.

Ps: I found this question prove that there are infinitely many primitive pythagorean triples $x,y,z$ such that $y=x+1$ But where does the hint come from?

  • $\begingroup$ Try replacing $y$ by $x+1$. $\endgroup$ – OkkesDulgerci Dec 11 '19 at 12:55
  • 1
    $\begingroup$ Perhaps you could make a spreadsheet and test some smallish values for $r\gt s \gt 0$? Note that $r$ must be at least $11$. $\endgroup$ – hardmath Dec 11 '19 at 13:02
  • 1
    $\begingroup$ @hardmath I just go with this method. Starting from r = 11 and solve the equation. Thanks. $\endgroup$ – Bella Dec 11 '19 at 15:11
  • 1
    $\begingroup$ That way not only finds the presumed solution, it proves that to be the smallest one (as required). $\endgroup$ – hardmath Dec 11 '19 at 15:28
  • $\begingroup$ @Bella You need not search any farther than Pell numbers $(4,3)$ to find $(r,s)=(12,5)$ to find the $(119,120,169)$ you were looking for. See how in my answer below. $\endgroup$ – poetasis Dec 13 '19 at 19:58

You basically search integer solutions to the equation $$2rs-(r^2-s^2)=1$$ which is equivalent to $$(r+s)^2-2r^2=1$$ which can be written as $$a^2-2b^2=1$$

This pell-equation has fundamental solution $a=3\ ,\ b=2$ giving $r=2$ and $s=1$ and the other solutions can be found by succesively multiplying the matrix $$\pmatrix{ 3 & 4 \\ 2 & 3}$$ with the current solution


You can generate Pythagorean triples where $B-A=\pm1$ in sequence with a seed Triple: $T_0=(0,0,1)$ using the following formula: $$A_{n+1}=3A_n+2C_n+1\qquad B_{n+1}=3A_n+2C_n+2\qquad C_{n+1}=4A_n+3C_n+2$$

For example, it generates the following $$T_1=(3,4,5)\qquad T_2=(20,21,29)\qquad T_3=(119,120,169)\qquad T_4=(697,696,985)$$ Another way to generate them directly is using Pell numbers that will feed Euclid's formula


This [Pell] function generates the series $1, 2, 5, 12, 29, 70, 169 ...$ and is a shoe-in for the $(r,s)$ pairs that generate $T_1, T_2, T_3 ...$ shown above. You find them using $\quad r_x=P_{x+1}\quad s_x=P_x\quad $ to obtain the following pairs (excuse using the letter P to describe pairs instead of individual Pell numbers):

$$P_1=(2,1)\quad P_2=(5,2)\quad P_3=(12,5)\quad P_4=(29,12)\quad P_5=(70,29)\quad P_6=(169,70)\quad ...$$

Once you have these, you plug them into Euclid's formula:

$$A=r^2-s^2\qquad B=2rs\qquad C=r^2+s^2$$

and since you want all sides to be greater than $100$, you need only start with Pell-number $3$. Hope this helps.


You have $ 2x^2 + 2x +1 = z^2$, or that $(2x+1)^2 - 2z^2 =-1$.

Are you familiar with Pell's equations to continue from here?

  • $\begingroup$ Yea I saw other related resources used Pell's equation. But our number theory course did not cover Pell's equation and I don't know whether there are any other ways to solve this problem. $\endgroup$ – Bella Dec 11 '19 at 13:01
  • 3
    $\begingroup$ The theory behind the hint in the linked question is from the Pell's equation, where we can generate another solution from the previous. Obviously you don't need to know the theory to demonstrate that the hint works, but otherwise it is hard to come up with the idea on your own. $\endgroup$ – Calvin Lin Dec 11 '19 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.