Continued Fraction calculator
Any real number x can be represented uniquely by a continued fraction:
x is equal to a sub 0 plus 1 over a sub 1 plus 1 over a sub 2 plus 1 over a sub 3 plus etcetera
where a1, a2, a3, ... are integer numbers greater than zero. A more compact representation is:
x is equal to a sub 0 plus double slash a sub 1, a sub 2, a sub 3, etcetera double slash
If the number to be represented is rational, there is a finite number of terms in the continued fraction. If the number is a quadratic irrationality of the form fraction whether the numerator is a plus the square root of b and the denominator is c , then the continued fraction is periodic. This calculator can find the continued fraction expansions of rational numbers and quadratic irrationalities.
You can type numbers or numerical expressions on the input boxes at the left.
The calculator accepts numbers of up to 10000 digits.
If you need the square root to subtract the number at the left, just negate both a and c.
If b is negative, the result is not a real number, so it cannot be represented as a continued fraction.
For rational numbers the calculator finds all convergents, but for quadratic irrationalities the calculator stops after the 100000th convergent if the period is larger.
You can use the following operators and parentheses for the expressions:
- + for addition
- - for subtraction
- * for multiplication
- / for integer division
- % for remainder
- ^ or ** for exponentiation
- n!: factorial
- p#: primorial (product of all primes less or equal than p).
- B(n): Previous pseudoprime to n
- F(n): Fibonacci number F sub n
- L(n): Lucas number L sub n = F sub n-1 + Fn+1
- N(n): Next pseudoprime to n
- P(n): Unrestricted Partition Number (number of decompositions of n into sums of integers without regard to order).
You can use the prefix 0x for hexadecimal numbers, for example 0x38 is equal to 56.
Written by Dario Alpern. Last updated 2 August 2016.
If you find an error or you have any comment, please fill the form.