Pythagorean Triples Calculator

Test three numbers, or list the Pythagorean triples up to a size.

A whole number from 5 to 1000.

Which triples

Primitive triples have no common factor.

Try

Result

You enteredc≤30, primitivec \le 30,\ \text{primitive}

(3,4,5), (5,12,13), (8,15,17), (7,24,25), (20,21,29)\displaystyle \left(3, 4, 5\right),\ \left(5, 12, 13\right),\ \left(8, 15, 17\right),\ \left(7, 24, 25\right),\ \left(20, 21, 29\right)

Count

5\displaystyle 5
Show the work
  1. Euclid's formula

    Every primitive Pythagorean triple comes from two whole numbers m>n>0m > n > 0 with no common factor, one even and one odd. The formula gives the legs aa and bb and the hypotenuse cc; keeping c≤30c \le 30 leaves 5 primitive triples.

    Using a=m2−n2, b=2mn, c=m2+n2a = m^2 - n^2,\ b = 2mn,\ c = m^2 + n^2

    m=2, n=1: (3,4,5)m=3, n=2: (5,12,13)m=4, n=1: (15,8,17)\begin{gathered} m = 2,\ n = 1:\ \left(3, 4, 5\right) \\ m = 3,\ n = 2:\ \left(5, 12, 13\right) \\ m = 4,\ n = 1:\ \left(15, 8, 17\right) \end{gathered}
  2. Result

    So there are 5 primitive triples with hypotenuse up to 30.

Worked examples