Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Continued fraction value f_n
1.4142135623731
truncated at n = 50 terms
Term n Convergent f_n
1 1.50000000000
2 1.40000000000
3 1.41666666667
4 1.41379310345
5 1.41428571429
6 1.41420118343
7 1.41421568627
8 1.41421319797
9 1.41421362489
10 1.41421355165
11 1.41421356421
12 1.41421356206
13 1.41421356243
14 1.41421356236
15 1.41421356237
16 1.41421356237
17 1.41421356237
18 1.41421356237
19 1.41421356237
20 1.41421356237
21 1.41421356237
22 1.41421356237
23 1.41421356237
24 1.41421356237
25 1.41421356237
26 1.41421356237
27 1.41421356237
28 1.41421356237
29 1.41421356237
30 1.41421356237

What this calculator does

This tool evaluates a continued fraction with constant terms: a continued fraction of the form \(f = b_0 + a/(b + a/(b + a/(b + \cdots)))\) where every partial numerator equals the same value \(a\) (your \(a_n\)) and every partial denominator equals the same value \(b\) (your \(b_n\)). The leading term \(b_0\) sits outside the fraction. It is a pure-mathematics tool and works the same everywhere.

How to use it

Enter the initial term b0, the constant numerator a_n, the constant denominator b_n, and the number of nested levels n (up to 1000). The calculator returns the truncated value \(f_n\) and a table of the early convergents \(f_1, f_2, f_3 \ldots\) so you can watch them settle on the limit.

The formula explained

The value is computed with a numerically stable backward (bottom-up) recurrence. Start at the innermost level with \(t = b\). Then for \(k\) from \(n\) down to 2, set \(t = b + a/t\). Finally \(f_n = b_0 + a/t\). The convergents table instead uses the classic Wallis recurrence \(h_m = b \cdot h_{m-1} + a \cdot h_{m-2}\) and \(k_m = b \cdot k_{m-1} + a \cdot k_{m-2}\), giving \(f_m = h_m/k_m\). When the fraction converges, the limit equals $$f = b_0 + \cfrac{-b + \sqrt{b^2 + 4a}}{2}$$

Advertisement
Nested fraction diagram showing a constant continued fraction with repeating numerator a and denominator b
The structure of a continued fraction with constant numerators a and denominators b.

Worked example

Take \(b_0 = 1\), \(a_n = 1\), \(b_n = 2\), \(n = 10\). The backward recurrence runs $$t = 2 \to 2.5 \to 2.4 \to 2.41667 \to \cdots \to 2.41421,$$ and \(f_{10} = 1 + 1/t \approx 1.41421356\), which is the square root of 2. Indeed $$1 + \cfrac{1}{2 + \cfrac{1}{2 + \cdots}} = \sqrt{2}.$$

Line chart showing successive convergents of a continued fraction oscillating and converging to a limit value
Successive convergents alternate above and below as they approach the limit.

FAQ

What if it does not converge? If an intermediate denominator becomes exactly 0, or \(b^2 + 4a < 0\), the value may be undefined or oscillate; the calculator reports "undefined" in that case.

Why a constant a_n and b_n? Many famous constants arise this way: \(a=1\), \(b=1\) gives the golden ratio \(1.6180339887\); \(a=1\), \(b=2\) gives \(\sqrt{2}\). A constant tail has a simple quadratic limit.

How accurate is f_n? For constant terms convergence is geometric, so a few dozen terms usually reach full double precision.

Last updated: