cp's OEIS Frontend

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.

A228825 Delayed continued fraction of e.

This page as a plain text file.
%I A228825 #11 Sep 09 2013 03:30:45
%S A228825 2,2,-1,-1,-1,-2,2,-2,1,1,1,2,-2,2,-2,2,-1,-1,-1,-2,2,-2,2,-2,2,-2,1,
%T A228825 1,1,2,-2,2,-2,2,-2,2,-2,2,-1,-1,-1,-2,2,-2,2,-2,2,-2,2,-2,2,-2,1,1,1,
%U A228825 2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-1,-1,-1,-2,2,-2
%N A228825 Delayed continued fraction of e.
%C A228825 An algorithm for the (usual) continued fraction of r > 0 follows:  x(0) = r, a(n) = floor(x(n)), x(n+1) = 1/(x(n) - a(n)).
%C A228825 The accelerated continued fraction uses "round" instead of "floor" (cf. A133593, A133570, A228667), where round(x) is the integer nearest x.
%C A228825 The delayed continued fraction (DCF) uses "second nearest integer", so that all the terms are in {-2, -1, 1, 2}.  If s/t and u/v are consecutive convergents of a DCF, then |s*x-u*t| = 1.
%C A228825 Regarding DCF(e), after the initial (2,2), the strings (-1,-1,-1) and (1,1,1) alternate with odd-length strings of the forms (-2,2,...,-2) and (2,-2,...,2).  The string lengths form the sequence 2,3,3,3,5,3,7,3,9,3,11,3,13,3,...
%C A228825 Comparison of convergence rates is indicated by the following approximate values of x-e, where x is the 20th convergent: for delayed CF, x-e = 5.4x10^-7; for classical CF, x-e = 6.1x10^-16; for accelerated CF, x-e = -6.6x10^-27.  The convergents for accelerated CF are a proper subset of those for classical CF, which are a proper subset of those for delayed CF (which are sampled in Example).
%e A228825 Convergents: 2, 5/2, 3, 8/3, 11/4, 30/11, 49/18, 68/25, 19/7, 87/32, 106/39, 299/110, 492/181,...
%t A228825 $MaxExtraPrecision = Infinity; x[0] = E; s[x_] := s[x] = If[FractionalPart[x] < 1/2, Ceiling[x], Floor[x]]; a[n_] := a[n] = s[Abs[x[n]]]*Sign[x[n]]; x[n_] := 1/(x[n - 1] - a[n - 1]); t = Table[a[n], {n, 0, 100}]
%Y A228825 Cf. A133570, A228826
%K A228825 cofr,sign,easy
%O A228825 0,1
%A A228825 _Clark Kimberling_, Sep 04 2013