HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /Find all pairs of positive integers (x, y) with x² - y² = 945…
HardMathematicsHigh School (11–12)Number TheoryNumericalOlympiad

Find all pairs of positive integers (x, y) with x² - y² = 945…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

Find all pairs of positive integers (x,y)(x, y)(x,y) with x2−y2=945x^2 - y^2 = 945x2−y2=945. Factor the left side, list the factor pairs of 945945945 with the smaller factor first, and turn each pair into a solution. Explain why every factor pair works here, which is not true for every number. Give the number of pairs and the largest possible xxx.

Check your answer

Work it out on paper, then type your number. The answer itself stays hidden.

Need a reminder? The key ideaShowHide

Factor into a product equal to a known number; order the unknowns and bound the smallest; compare remainders modulo a well-chosen number. Pell's equation x2−dy2=1x^2 - dy^2 = 1x2−dy2=1 has the solutions

xk+ykd=(x1+y1d)k.\displaystyle x_k + y_k\sqrt d = (x_1 + y_1\sqrt d)^k.xk​+yk​d​=(x1​+y1​d​)k.

The worked solution

Check an answer or open a hint to unlock the worked solution.

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

Given. (x−y)(x+y)=945(x - y)(x + y) = 945(x−y)(x+y)=945 with 0<x−y<x+y0 < x - y < x + y0<x−y<x+y.

Step 1. Factor pairs. 945=33⋅5⋅7945 = 3^3 \cdot 5 \cdot 7945=33⋅5⋅7 has 161616 divisors, so 888 pairs p×qp \times qp×q with p<qp < qp<q: 1×9451 \times 9451×945, 3×3153 \times 3153×315, 5×1895 \times 1895×189, 7×1357 \times 1357×135, 9×1059 \times 1059×105, 15×6315 \times 6315×63, 21×4521 \times 4521×45, 27×3527 \times 3527×35.

Step 2. Parity. 945945945 is odd, so both factors in each pair are odd. Then x=p+q2x = \tfrac{p + q}{2}x=2p+q​ and y=q−p2y = \tfrac{q - p}{2}y=2q−p​ are whole numbers, and y>0y > 0y>0 since p<qp < qp<q.

Step 3. The solutions. (473,472)(473, 472)(473,472), (159,156)(159, 156)(159,156), (97,92)(97, 92)(97,92), (71,64)(71, 64)(71,64), (57,48)(57, 48)(57,48), (39,24)(39, 24)(39,24), (33,12)(33, 12)(33,12), (31,4)(31, 4)(31,4).

Check. 312−42=961−16=94531^2 - 4^2 = 961 - 16 = 945312−42=961−16=945.

Answer: 888 pairs, the largest xxx being 473473473.

Watch out. For an even number the two factors must both be even, so only some pairs work, and a number ≡2(mod4)\equiv 2 \pmod 4≡2(mod4) gives none.

Log in to save this for later
← All Problems
← A teacher wants a list of every primitive Pythagorean triple whose hypotenuse is less than 100…Find every triple of positive integers a ≤ b ≤ c with 1/a + 1/b + 1/c = 1, and prove that there are… →
More onNumber Theory

Discussion (0)

Log in to join the discussion.

Loading…

More on this topic

  1. The triangular numbers are 1, 3, 6, 10, …, where the nth one is (n(n + 1))/2…Advanced
  2. Prove that the equation x³ + y³ + z³ = n has no solution in integers when n leaves remainder 4 or 5…Advanced
  3. Find every triple of positive integers a ≤ b ≤ c with 1/a + 1/b + 1/c = 1, and prove that there are…Advanced
  4. A teacher wants a list of every primitive Pythagorean triple whose hypotenuse is less than 100…Advanced
  5. Prove that the product abc of the three sides of every Pythagorean triple is a multiple of 60…Advanced
All problems on this topic →