This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A133593 #24 Oct 22 2021 11:35:52 %S A133593 3,7,16,-294,3,-4,5,-15,-3,2,2,2,2,3,-85,-3,2,15,3,14,-5,-2,-6,-6, %T A133593 -100,3,2,6,3,6,-2,-6,-9,9,-3,-3,-8,4,-2,-13,3,-5,2,9,-2,-3,8,-2,-5, %U A133593 -2,-2,-4,3,4,4,17,-162,-46,24,-3,-3,6,-3,-25,4,-5,4,-2,-10,-2,-5,-5,3,2,9,-6,-2,-2,-27,6,-2,-8,-2,-42,-3,8,3,4,-2,-7,-2,-4 %N A133593 "Exact" continued fraction for Pi. %C A133593 Terms were obtained using high precision arithmetic with GMP 4.2.2, using 10000 decimal digits of Pi obtained from the Internet. %C A133593 If we use "closest integer function" instead of the common practice of using floor(x) when calculating continued fractions, we obtain a sequence of (not just positive but also occasionally negative) integers which approximate the original number better "per term" in the sequence. I will refer to such continued fractions as "exact". %C A133593 For instance, 3+1/(7+1/16) = 3.14159292..., 3+1/(7+1/15) = 3.141509434...; %C A133593 3+1/(7+1/(16+1/(-294+1/3))) = 3.141592653619..., 3+1/(7+1/(15+1/(1+1/292))) = 3.141592653012... %C A133593 It is easy to see that as long as the fractional part of x(n) is in [0, 0.5), the usual continued fraction and exact continued fraction agree in terms, but whenever the fractional part of x(n) gets to be in (0.5, 1) then the exact continued fraction gives better approximations more and more at each term. %C A133593 Another example is that the exact continued fraction of the golden ratio is 2,-3,3,-3,3,... which gives a better approximation at any number of initial terms than does the usual 1,1,1,... at the same number of initial terms. %C A133593 For |x|>2, ECF(1/x) = [0, ECF(x)]. %C A133593 ECF(sqrt(3))=2,-4,4,-4,4,... %C A133593 ECF(1/sqrt(3))=1,-2,-3,4,-4,4,-4, ... %C A133593 ECF(-x) is just ECF(x) with signs reversed. %C A133593 x(n)-a(n) is in [-0.5, 0.5], hence for n>0, |a(n)| >= 2. %C A133593 From _Giovanni Artico_, Oct 23 2013: (Start) %C A133593 Comparing this expansion with the standard simple continued fraction expansion (A001203) we can notice that: %C A133593 - the convergents of this expansion are a subset of those of the standard one; %C A133593 - the differences between these convergents and the given number no longer have strictly alternating signs; e.g., for Pi the sequence of signs starts with -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1. %C A133593 For each term in this sequence of signs that is equal to its successor, there is a missing convergent from the standard set of convergents. (End) %H A133593 Maxim Sølund Kirsebom, <a href="https://doi.org/10.3390/e23070840">Extreme Value Theory for Hurwitz Complex Continued Fractions</a>, Entropy (2021) Vol. 23, No. 7, 840. %F A133593 x(0) = Pi, a(n) = floor(|x(n)| + 0.5) * sign(x(n)), where x(n+1) = 1/(x(n)-a(n)). %e A133593 Pi = 3+1/(7+1/(16+1/(-294+1/(3+1/(-4+1/(5+1/(-15+1/(-3+...)))))))) %e A133593 or Pi = 3+1/(7+1/(16-1/(294-1/(3-1/(4-1/(5-1/(15+1/(3+...)))))))). - _Giovanni Artico_, Oct 23 2013 %p A133593 ECF := proc (n, q::posint)::list; local L, i, z; Digits := 10000; L := [round(n)]; z := n; for i from 2 to q do if z = op(-1, L) then break end if; z := 1/(z-op(-1, L)); L := [op(L), round(z)] end do; return L end proc %p A133593 ECF(Pi,120) # _Giovanni Artico_, Oct 23 2013 %t A133593 $MaxExtraPrecision = Infinity; x[0] = Pi; a[n_] := a[n] = Round[Abs[x[n]]]*Sign[x[n]]; x[n_] := 1/(x[n - 1] - a[n - 1]); Table[a[n], {n, 0, 120}] (* _Clark Kimberling_, Sep 04 2013 *) %Y A133593 Cf. A001203. %K A133593 cofr,sign %O A133593 0,1 %A A133593 Serhat Sevki Dincer (jfcgauss(AT)gmail.com), Dec 27 2007, Dec 30 2007, Jan 31 2008 %E A133593 Edited by _Jon E. Schoenfield_, Nov 23 2016