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 fractionDlmfMathworldPlanetmath of a number, be it a rational numberPlanetmathPlanetmathPlanetmath 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 fractionMathworldPlanetmath 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. 1.

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

  2. 2.

    Calculate the reciprocal of this number.

  3. 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 3MathworldPlanetmath, 3, using the Windows Calculator in scientific mode. 3 ^ (1 / 2) = gives us 1.7320508075688772935274463415059.

  1. 1.

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

  2. 2.

    The reciprocal of that number is 1.3660254037844386467637231707529.

  3. 3.

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

  4. 4.

    The reciprocal of that number is 2.7320508075688772935274463415059.

  5. 5.

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

  6. 6.

    The reciprocal of that number is 1.3660254037844386467637231707529.

  7. 7.

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

  8. 8.

    The reciprocal of that number is 2.7320508075688772935274463415059.

  9. 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 iterationsMathworldPlanetmath 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 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 numbersMathworldPlanetmath 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.

Title method for computing simple continued fractions with the aid of calculator and pencil and paper
Canonical name MethodForComputingSimpleContinuedFractionsWithTheAidOfCalculatorAndPencilAndPaper
Date of creation 2013-03-22 17:29:56
Last modified on 2013-03-22 17:29:56
Owner PrimeFan (13766)
Last modified by PrimeFan (13766)
Numerical id 4
Author PrimeFan (13766)
Entry type AlgorithmMathworldPlanetmath
Classification msc 11A55
Classification msc 11J70
Classification msc 11Y65