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.

A228826 Delayed continued fraction of sqrt(2).

This page as a plain text file.
%I A228826 #17 Sep 08 2022 08:46:05
%S A228826 2,-1,-2,1,2,-1,-2,1,2,-1,-2,1,2,-1,-2,1,2,-1,-2,1,2,-1,-2,1,2,-1,-2,
%T A228826 1,2,-1,-2,1,2,-1,-2,1,2,-1,-2,1,2,-1,-2,1,2,-1,-2,1,2,-1,-2,1,2,-1,
%U A228826 -2,1,2,-1,-2,1,2,-1,-2,1,2,-1,-2,1,2,-1,-2,1,2,-1
%N A228826 Delayed continued fraction of sqrt(2).
%C A228826 See A228825 for a definition of delayed continued fraction (DCF).
%C A228826 DCF(r) is periodic if and only if CF(r) is periodic; DCF(sqrt(n)) is shown here for selected values of n,using Mathematica notation for periodic continued fractions.
%C A228826 n ........ DCF(sqrt(n))
%C A228826 2 ........ {2, {-1,-2,1,2}}
%C A228826 3 ........ {{1,2,-1,-1,-2,1}}
%C A228826 5 ........ {3, {-2,2,-1,-2,2,-2,1,2}}
%C A228826 6 ........ {3, {-1,-2,2,-2,1,2}}
%C A228826 7 ........ {2, {1,1,2,-2,2,-1,-1,-1,-1,-2,2,-2,1,1}}
%C A228826 8 ........ {2, {2,-2,2,-1,-1,-2,2,-2,1,1}}
%C A228826 10........ {4, {-2,2,-2,2,-1,-2,2,-2,2,-2,1,2}}
%H A228826 G. C. Greubel, <a href="/A228826/b228826.txt">Table of n, a(n) for n = 0..1000</a>
%H A228826 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,-1).
%F A228826 From _Colin Barker_, Sep 13 2013: (Start)
%F A228826 a(n) = ((2-i)*(-i)^n + (2+i)*i^n)/2 where i=sqrt(-1).
%F A228826 a(n) = -a(n-2).
%F A228826 G.f.: (2-x)/(x^2+1). (End)
%e A228826 convergents: 2, 1, 4/3, 3/2, 10/7, 7/5, 24/17, 17/12, 58/41, 41/29, 140/99, ...
%t A228826 $MaxExtraPrecision = Infinity; x[0] = Sqrt[2]; 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}]
%t A228826 LinearRecurrence[{0,-1}, {2,-1}, 50] (* _G. C. Greubel_, Aug 19 2018 *)
%o A228826 (PARI) Vec(-(x-2)/(x^2+1) + O(x^100)) \\ _Colin Barker_, Sep 13 2013
%o A228826 (Magma) I:=[2,-1]; [n le 2 select I[n] else  - Self(n-2): n in [1..30]]; // _G. C. Greubel_, Aug 19 2018
%Y A228826 Cf. A133570, A228825
%K A228826 cofr,sign,easy
%O A228826 0,1
%A A228826 _Clark Kimberling_, Sep 04 2013