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. /A teacher wants a list of every primitive Pythagorean triple whose hypotenuse is less than 100…
AdvancedMathematicsHigh School (11–12)Number TheoryNumericalOlympiad

A teacher wants a list of every primitive Pythagorean triple whose hypotenuse is less than 100…

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.

A teacher wants a list of every primitive Pythagorean triple whose hypotenuse is less than 100100100. Use the formula: count the pairs m>n>0m > n > 0m>n>0 with gcd⁡(m,n)=1\gcd(m, n) = 1gcd(m,n)=1, mmm and nnn of opposite parity, and m2+n2<100m^2 + n^2 < 100m2+n2<100. Organise the count by the value of mmm. Give the number of triples and the largest hypotenuse below 100100100.

Check your answer

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

Need a reminder? The key ideaShowHide

Every primitive triple is m2−n2m^2 - n^2m2−n2, 2mn2mn2mn, m2+n2m^2 + n^2m2+n2 with m>nm > nm>n coprime and of opposite parity. A triple with leg aaa comes from a factor pair

a2=(c−b)(c+b),\displaystyle a^2 = (c - b)(c + b),a2=(c−b)(c+b),

with both factors of the same parity.

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. Pairs m>n>0m > n > 0m>n>0, coprime, opposite parity, m2+n2<100m^2 + n^2 < 100m2+n2<100.

Step 1. By mmm.

  • m=2m = 2m=2: n=1n = 1n=1. One pair.
  • m=3m = 3m=3: n=2n = 2n=2. One pair.
  • m=4m = 4m=4: n=1,3n = 1, 3n=1,3. Two pairs.
  • m=5m = 5m=5: n=2,4n = 2, 4n=2,4. Two pairs.
  • m=6m = 6m=6: n=1,5n = 1, 5n=1,5. Two pairs.
  • m=7m = 7m=7: n=2,4,6n = 2, 4, 6n=2,4,6. Three pairs.
  • m=8m = 8m=8: n=1,3,5n = 1, 3, 5n=1,3,5. Three pairs (n=7n = 7n=7 gives 113113113).
  • m=9m = 9m=9: n=2,4n = 2, 4n=2,4. Two pairs (n=8n = 8n=8 gives 145145145).

Step 2. Add. 1+1+2+2+2+3+3+2=161 + 1 + 2 + 2 + 2 + 3 + 3 + 2 = 161+1+2+2+2+3+3+2=16.

Step 3. The largest hypotenuse. The largest m2+n2m^2 + n^2m2+n2 below 100100100 is 81+16=9781 + 16 = 9781+16=97, from m=9m = 9m=9, n=4n = 4n=4: the triple (65,72,97)(65, 72, 97)(65,72,97).

Check. Each pair gives a different primitive triple, because the formula is one to one.

Answer: 161616 primitive triples, the largest hypotenuse being 979797.

Log in to save this for later
← All Problems
← Prove that the product abc of the three sides of every Pythagorean triple is a multiple of 60…Find all pairs of positive integers (x, y) with x² - y² = 945… →
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. Find all pairs of positive integers (x, y) with x² - y² = 945…Hard
  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 →