Maths WorkshopMaths problems with full solutions
Exercise 622Number theory › Diophantine equationsM1Added 4 Nov 2026

x² − y² = 2024

#Diophantine equations#factoring#parity#divisors

Statement

Find all integer solutions of x2−y2=2024x^2-y^2=2024.

Hint

Factor (x−y)(x+y)=2024(x-y)(x+y)=2024. What can you say about the parities of x−yx-y and x+yx+y?

Show solutionHide solution

Solution

Idea. A product of two integers with prescribed sum parity: enumerate factor pairs.

Parity. x−yx-y and x+yx+y have the same parity. Their product 2024=23⋅11⋅232024=2^3\cdot11\cdot23 is even, so both factors are even. Write x−y=2ux-y=2u, x+y=2vx+y=2v with uv=506=2⋅11⋅23uv=506=2\cdot11\cdot23. Then x=u+vx=u+v, y=v−uy=v-u.

Positive factor pairs of 506506. Divisors: 1,2,11,22,23,46,253,5061,2,11,22,23,46,253,506. With u≤vu\le v and uv=506uv=506:
(1,506), (2,253), (11,46), (22,23).(1,506),\ (2,253),\ (11,46),\ (22,23).

Non-negative solutions (x,y)=(u+v,v−u)(x,y)=(u+v,v-u).
(507,505), (255,251), (57,35), (45,1).(507,505),\ (255,251),\ (57,35),\ (45,1).

All integer solutions. Changing the signs of xx and/or yy gives 4⋅4=164\cdot4=16 solutions: (±507,±505)(\pm507,\pm505), (±255,±251)(\pm255,\pm251), (±57,±35)(\pm57,\pm35), (±45,±1)(\pm45,\pm1).

Check. 452−1=202445^2-1=2024 ✓.

Remark. A number NN is a difference of two squares iff N≢2(mod4)N\not\equiv2\pmod4; 2024≡0(mod4)2024\equiv0\pmod4 works.

Lesson. Factor the equation into a product of two integers, then enumerate divisors using parity and size constraints.