Files
freeCodeCamp/guide/english/mathematics/pythagorean-triples/index.md

16 lines
624 B
Markdown
Raw Normal View History

2018-10-12 15:37:13 -04:00
---
title: Pythagorean Triples
---
## Pythagorean Triples
A pythagorean triple is a set of three numbers, a, b, and c, that satisfies the equation `a^2 + b^2 = c^2`. When a triangle is made with side lengths equal to a, b, and c, it will be a right triangle.
2018-10-12 15:37:13 -04:00
The smallest pythagorean triple is 3,4,5. There is an infinite number of these pythagorean triples. They can be constructed using the following process:
2018-10-12 15:37:13 -04:00
When m and n are positive integers such that m is less than n:
2018-10-12 15:37:13 -04:00
- a = `n^2 - m^2`
- b = `2nm`
- c = `n^2 + m^2`
2018-10-12 15:37:13 -04:00
Then a, b, and c will form a pythagorean triple. The formula above is known as Euclid's formula.