# Math Help - Euclid's algorithm

1. ## Euclid's algorithm

By adapting Euclid's algorithm, and integers a; b lying between 1 and 1000
such that their quotient a/b agrees with the constant pi up
to 6 decimal places (3.14159265)

Any help with be much appreciated!

2. Hello, mx-!

I don't see how to "adapt Euclid algorithm",
. . but there is a continued fraction approach.

By adapting Euclid's algorithm, find integers $a, b$ between 1 and 1000 such that
their quotient $\frac{a}{b}$ agrees with the constant $\pi$ up to 6 decimal places (3.14159265)

. . $\pi \;=\;3.14159262654 \;= \;3 + 0.141592654$

. . . . $= \;3 + \frac{1}{7.062513306} \;=\;3 + \frac{1}{7 + 0.62513306}$

. . . . $= \;3 + \frac{1}{7 + \dfrac{1}{15.99659441}} \;\approx\;3 + \frac{1}{7 + \frac{1}{16}}$

Therefore: . $\pi \;\approx\:3 + \frac{1}{7 + \frac{1}{16}} \;=\; 3 + \frac{1}{\frac{113}{16}} \;=\;3 + \frac{16}{113} \;=\;\frac{355}{113}$

. . $\begin{array}{ccc}\dfrac{355}{113} &=& {\color{blue}3.141592}92... \\ \\[-3mm]
\pi &=& {\color{blue}3.141592}65...\end{array}$

This is the only solution to this problem.