# How to find irrational approximates

Say I have a rational number, $n$, that approximates an irrational number of the form:

$$n \approx {a+\sqrt b \over c}$$

in terms of being irrational.

What is a good way of finding the unknown integer constants $a$, $b$, and $c$?

Ex: $n = {33385282\over 20633239} \approx 1.618034 \approx \phi \approx {1 + \sqrt 5 \over 2}$ (note that $\phi$ (the golden ratio) is merely for example)

Thus $a = 1$, $b = 5$, and $c = 2$ for this example.

I know that since $n^2 \approx {a^2 + 2a\sqrt b + b \over c^2}$,you could find $a$ and $b$ by multiplying $n^2$ by $c^2$, and then subtracting $xnc$, finding the value of $x$ that makes the difference an integer. Then $x = 2a$, and $b$ can be solved using substitution algebra. But, all that implies that $c$ is known, and that's where I'm stuck.

Ex: $c$ is known, thus $c = 2$

$n^2c^2 \approx 10.472135$

$n^2c^2 - nc \approx 7.2360680$

$n^2c^2 - 2nc \approx 4$ ($x$ is now $2$ because $4$ is an interger)

$a = x/2 = {2/2} = 1$, $b = \text algebra = 5$

So how do I find $c$ first, or what is a better way to go about solving $a$, $b$, and $c$ other than by trial?

• Your example doesn't make sense. You say at first that $n$ is irrational but then you write $n={33385282\over 20633239}$. – Lee Mosher Jul 11 '14 at 20:36
• $n$ approximates an irrational number, but n is a rational number – Dane Bouchie Jul 11 '14 at 20:38
• I still cannot understand what you are asking. $n$ is both rational and irrational in your question. – Lee Mosher Jul 11 '14 at 20:41
• I just edited it to clear that up. – Dane Bouchie Jul 11 '14 at 20:41
• Okay, looks good now. – Lee Mosher Jul 11 '14 at 20:43

You can do this with simple continued fractions. First, you are guaranteed to get an irrational by finding the complete scf for your rational number, then simply repeat that again and again forever. Such "purely periodic" scf's correspond to "reduced" quadratic irrationals.

Meanwhile, if you get good enough with scf's you may be able to spot when repetition seems to begin of its own accord. If so, you fill in the pattern, and get a simpler quadratic irrational, probably not reduced.

• en.wikipedia.org/wiki/Periodic_continued_fraction#Reduced_surds – Will Jagy Jul 11 '14 at 20:47
• Just so I understand correctly, $\sqrt b$ has a continued fraction that will show up in the $n$ continued fraction, that then reduces to the $\sqrt b$ part in the approximate form I listed? – Dane Bouchie Jul 11 '14 at 20:52
• @DaneBouchie, $\sqrt b$ gives a very predictable pattern, $$[a_0,a_1, \cdots, 2 a_0 ]$$ and the part $$a_1, a_2, ... 2_a_0$$ repeats forever. Here $a_0 = \lfloor \sqrt b \rfloor.$ So $a_0 + \sqrt b$ has a purely periodic scf. Worth practicing, scf's simplify a number of tasks. – Will Jagy Jul 11 '14 at 20:54
• I understand that, but will the pattern of $\sqrt b$ show up in the $n$ continued fraction? – Dane Bouchie Jul 11 '14 at 20:55
• @DaneBouchie, it's your question. I recommend you try it, start with tables of continued fractions for $\sqrt b$ for small $b.$ – Will Jagy Jul 11 '14 at 20:58

Of course, ther are many irrationaly that are approximately your given rational and what you are looking for is somewhat the "simplest" among all close enough quadratic irrationals.

I suggest, you transform your given fraction into a continued fraction. Just doing a few steps, you should find $$\frac{33385282}{20633239}=1+\frac1{1+\frac1{1+\frac1{1+\frac{3010349}{4870847}}}}$$ and in fact you will get a few more $1$s upon proceeding, but the pattern is already apparent. Therefore we make the educated guess that our irrational number is the one with this pattern repeating indefinitely as continued fraction, i.e. $$\alpha=1+\frac1{1+\frac1{1+\frac1{1+\frac1{1+\frac1{1+\frac1{1+\frac1{1+\frac1{\ddots}}}}}}}}$$ As this means $\alpha=1+\frac 1\alpha$, we arrive at $\alpha=\frac{1+\sqrt 5}{2}$.