The Pythagoreans were students of Pythagoras' school of thought.They subscribed to Pythagoreanism,a philosophy that was dominated by mathematics and mysticism.
A
Pythagorean triple
consists of three positive integers
(
a
,
b
,
c
)
such that
a
2
+
b
2
=
c
2
.
A triple is said to be
primitive
if
a
,
b
and
c
are co-prime to each other(
G
C
D
(
a
,
b
,
c
)
=
1
).
There are
1
6
primitive
triples with
c
≤
1
0
0
and
a
<
b
<
c
as shown below.
(
3
,
4
,
5
)
,
(
5
,
1
2
,
1
3
)
,
(
8
,
1
5
,
1
7
)
,
(
7
,
2
4
,
2
5
)
(
2
0
,
2
1
,
2
9
)
,
(
1
2
,
3
5
,
3
7
)
,
(
9
,
4
0
,
4
1
)
,
(
2
8
,
4
5
,
5
3
)
(
1
1
,
6
0
,
6
1
)
,
(
1
6
,
6
3
,
6
5
)
,
(
3
3
,
5
6
,
6
5
)
,
(
4
8
,
5
5
,
7
3
)
(
1
3
,
8
4
,
8
5
)
,
(
3
6
,
7
7
,
8
5
)
,
(
3
9
,
8
0
,
8
9
)
,
(
6
5
,
7
2
,
9
7
)
Find the number of
primitive
Pythagorean triples with
c
≤
1
0
6
and
a
<
b
<
c
?
Details and assumptions
-
You may assume that the triplets
(
a
,
b
,
c
)
and
(
b
,
a
,
c
)
are the same when counting.
-
This was inspired by a
projecteuler
problem
-
For more about Pythagoreans and irrational numbers take a look at Peter's note on
the discovery of irrational numbers
.
-
There is a great interactive tutorial on pythagorean triples
here
.
This is the same as counting the couples of integers ( u , v ) such that: 1 ≤ u < v ≤ 1 0 0 0 , u 2 + v 2 ≤ 1 0 6 , g cd ( u , v ) = 1 and one integer between u and v is even. With a couple of cycles we get the answer: 1 5 9 1 3 9 . This is very close to 2 π 1 0 6 and not by chance, since the asymptotic probability of two random integers in I = [ 1 , N ] of being coprime is π 2 6 and the asymptotic probability of two random integers a , b ∈ I to satisfy a 2 + b 2 ≤ N 2 is 4 π .