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.

Showing 1-3 of 3 results.

A228826 Delayed continued fraction of sqrt(2).

Original entry on oeis.org

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, 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, -2, 1, 2, -1, -2, 1, 2, -1, -2, 1, 2, -1, -2, 1, 2, -1, -2, 1, 2, -1
Offset: 0

Views

Author

Clark Kimberling, Sep 04 2013

Keywords

Comments

See A228825 for a definition of delayed continued fraction (DCF).
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.
n ........ DCF(sqrt(n))
2 ........ {2, {-1,-2,1,2}}
3 ........ {{1,2,-1,-1,-2,1}}
5 ........ {3, {-2,2,-1,-2,2,-2,1,2}}
6 ........ {3, {-1,-2,2,-2,1,2}}
7 ........ {2, {1,1,2,-2,2,-1,-1,-1,-1,-2,2,-2,1,1}}
8 ........ {2, {2,-2,2,-1,-1,-2,2,-2,1,1}}
10........ {4, {-2,2,-2,2,-1,-2,2,-2,2,-2,1,2}}

Examples

			convergents: 2, 1, 4/3, 3/2, 10/7, 7/5, 24/17, 17/12, 58/41, 41/29, 140/99, ...
		

Crossrefs

Programs

  • Magma
    I:=[2,-1]; [n le 2 select I[n] else  - Self(n-2): n in [1..30]]; // G. C. Greubel, Aug 19 2018
  • Mathematica
    $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}]
    LinearRecurrence[{0,-1}, {2,-1}, 50] (* G. C. Greubel, Aug 19 2018 *)
  • PARI
    Vec(-(x-2)/(x^2+1) + O(x^100)) \\ Colin Barker, Sep 13 2013
    

Formula

From Colin Barker, Sep 13 2013: (Start)
a(n) = ((2-i)*(-i)^n + (2+i)*i^n)/2 where i=sqrt(-1).
a(n) = -a(n-2).
G.f.: (2-x)/(x^2+1). (End)

A280136 Negative continued fraction of e (or negative continued fraction expansion of e).

Original entry on oeis.org

3, 4, 3, 2, 2, 2, 3, 8, 3, 2, 2, 2, 2, 2, 2, 2, 3, 12, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 16, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 20, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 24, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Randy L. Ekl, Dec 26 2016

Keywords

Comments

After the first term (3), a pattern of groups consisting, for m>=1, of the number 4m, followed by 3, then 4m-1 2's, then 3.

Examples

			e = 2.71828... = 3 - 1/(4 - 1/(3 - 1/(...))).
		

References

  • Leonard Eugene Dickson, History of the Theory of Numbers, page 379.

Crossrefs

Cf. A003417 (continued fraction of e).
Cf. A005131 (generalized continued fraction of e).
Cf. A133570 (exact continued fraction of e).
Cf. A228825 (delayed continued fraction of e).
Cf. A280135 (negative continued fraction of Pi).

Programs

  • PARI
    \p10000; p=exp(1.0); for(i=1, 300, print(i, " ", ceil(p)); p=ceil(p)-p; p=1/p )

Extensions

More terms from Jinyuan Wang, Mar 04 2020

A228941 The n-th convergent of CF(e) is the a(n)-th convergent of DCF(e), the delayed continued fraction of e.

Original entry on oeis.org

1, 3, 4, 5, 9, 10, 11, 17, 18, 19, 27, 28, 29, 39, 40, 41, 53, 54, 55, 69, 70, 71, 87, 88, 89, 107, 108, 109
Offset: 1

Views

Author

Clark Kimberling, Sep 08 2013

Keywords

Comments

See A228825 for a definition of delayed continued fraction. Is A014209 is a subsequence of A228941? It appears that the difference sequence of A228941, namely (2,1,1,4,1,1,6,1,1,...), is the continued fraction of (e-2)/(3-e).

Examples

			The convergents of CF(e) are 2, 3, 8/3, 11/4, 19/7, 87/32, 106/39, ...; the convergents of DCF(e) are 2, 5/2, 3, 8/3, 11/4, 30/11, 49/18, 68/25, 19/7, 87/32, 106/39,...; a(5) = 9 because 19/7 is the 9th convergent of DCF(e).
		

Crossrefs

Programs

  • Mathematica
    $MaxExtraPrecision = Infinity; x[0] = E; s[x_] := s[x] = If[FractionalPart[x] < 1/2, Ceiling[x], Floor[x]]; f[n_] := f[n] = s[Abs[x[n]]]*Sign[x[n]]; x[n_] := 1/(x[n - 1] - f[n - 1]); t = Table[f[n], {n, 0, 120}] ;(* A228825; delayed cf of x[0] *); t1 = Convergents[t]; t2 = Convergents[ContinuedFraction[E, 120]]; Flatten[Table[Position[t1, t2[[n]]], {n, 1, 28}]]

Formula

Empirical g.f.: x*(x^5+x^3-x^2-2*x-1) / ((x-1)^3*(x^2+x+1)^2). - Colin Barker, Sep 13 2013
Showing 1-3 of 3 results.