## You are here

Homemethod for computing simple continued fractions with the aid of calculator and pencil and paper

## Primary tabs

# method for computing simple continued fractions with the aid of calculator and pencil and paper

In most computer algebra systems, there is often a simple command for obtaining the continued fraction of a number, be it a rational number or an irrational number.

But with the aid of a scientific calculator, a software calculator or perhaps even a basic pocket calculator, one can calculate some continued fractions, though with some caveats about possible loss of precision.

For this method, one needs some way of calculating a reciprocal. On a scientific calculator, there usually is a key labeled “`1/x`

”. If there isn’t, but there is a key for the displayed answer (such as on 2-line scientific calculators) one can then use “`1 / ANS`

”. A workaround on a limited basic calculator is possible if the calculator has user-accessible memory registers.

Before starting, it might be a good idea to decide on a value to stop at if the pattern for a periodic continued fraction does not make itself apparent. If one knows in advance the continued fraction is neither periodic nor terminating, one should then decide on a stopping value, preferably before loss of precision sets in.

This method is for non-integers. Starting with the number currently displayed, the method is as follows:

1. If there is an integer portion to the number, subtract it and write it down on a sheet of paper.

2. Calculate the reciprocal of this number.

3. If the result is an integer, then the method is done. Likewise if one notices a pattern to the continued fraction. Otherwise, go back to step 1 with the number on the display.

For example, let’s say we wish to compute the continued fraction of the square root of 3, $\sqrt{3}$, using the Windows Calculator in scientific mode. `3 ^ (1 / 2) =`

gives us 1.7320508075688772935274463415059.

1. We subtract the 1 and write it down, leaving 0.73205080756887729352744634150587 on the display.

2. The reciprocal of that number is 1.3660254037844386467637231707529.

3. We subtract the 1 and write it down, leaving 0.36602540378443864676372317075294 on the display.

4. The reciprocal of that number is 2.7320508075688772935274463415059.

5. We subtract the 2 and write it down, leaving 0.73205080756887729352744634150587 on the display.

6. The reciprocal of that number is 1.3660254037844386467637231707529.

7. We subtract the 1 and write it down, leaving 0.36602540378443864676372317075294 on the display.

8. The reciprocal of that number is 2.7320508075688772935274463415059.

9. We subtract the 2 and write it down. At this point it seems obvious that after the integer part, this continued fraction simply repeats 1 and 2 periodically. A couple more iterations support this assumption.

Of course the possible loss of precision in floating point arithmetic can cause this method to give erroneous or misleading answers. The continued fraction of $\sqrt{47}$ seems misleadingly to have an excessively long period with this method carried out on a CVS-brand scientific calculator. Similarly, a continued fraction from the first 25 prime numbers was constructed on that same calculator, giving the displayed value of 2.31303673. Application of this method recovered the first eight primes followed by 21.

## Mathematics Subject Classification

11A55*no label found*11J70

*no label found*11Y65

*no label found*

- Forums
- Planetary Bugs
- HS/Secondary
- University/Tertiary
- Graduate/Advanced
- Industry/Practice
- Research Topics
- LaTeX help
- Math Comptetitions
- Math History
- Math Humor
- PlanetMath Comments
- PlanetMath System Updates and News
- PlanetMath help
- PlanetMath.ORG
- Strategic Communications Development
- The Math Pub
- Testing messages (ignore)

- Other useful stuff
- Corrections