A continued fraction can be seen as a way to approximate numbers with increasingly involved fractions. For example for $\pi$ it is $$\pi=3+\frac{1}{7+\frac{1}{15+\frac{1}{1+\dots}}}$$ Define $\pi_n$ as the number you get by only including $n$ terms in this continued fraction. I plotted the absolute error $|\pi_n-\pi|$ here below:
My question is about the jump at 292. 292 is a large number so I would expect that adding this term wouldn't increase precision by much. My reasoning is as follows. Consider the innermost nested fraction that still includes 292: $$\frac{1}{1+\frac{1}{292}}$$ Now, if I remove 292, I will essentially remove $1/292$. Like this: $$\frac{1}{1+0}$$
I removed a small number since 292 is a large number. Therefore, I would expect a small jump when going from $n=4$ to $n=5$. But instead I see a large jump so obviously my reasoning is not correct. What would be the correct reasoning?
The Mathematica code I used to create the plot:
piN[n_] := FromContinuedFraction[ContinuedFraction[\[Pi], n]]
error = Table[
Labeled[{n, Abs[piN[n] - \[Pi]] // N},
ContinuedFraction[\[Pi], n][[-1]]], {n, 1, 10}];
ListLogPlot[error, PlotRange -> Full,
AxesLabel -> {n, "Absolute Error"},
PlotLabel -> "|\!\(\*SubscriptBox[\(\[Pi]\), \(n\)]\)-\[Pi]|"]
