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.

A120691 First differences of coefficients in the continued fraction for e.

This page as a plain text file.
%I A120691 #23 Dec 28 2022 09:04:43
%S A120691 2,-1,1,-1,0,3,-3,0,5,-5,0,7,-7,0,9,-9,0,11,-11,0,13,-13,0,15,-15,0,
%T A120691 17,-17,0,19,-19,0,21,-21,0,23,-23,0,25,-25,0,27,-27,0,29,-29,0,31,
%U A120691 -31,0,33,-33,0,35,-35,0,37,-37,0,39,-39
%N A120691 First differences of coefficients in the continued fraction for e.
%C A120691 First differences of A003417.
%H A120691 G. C. Greubel, <a href="/A120691/b120691.txt">Table of n, a(n) for n = 0..1000</a>
%H A120691 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (-1,-1,1,1,1).
%F A120691 G.f.: (1-x)*(2+x+2*x^2-3*x^3-x^4+x^6)/(1-2*x^3+x^6).
%F A120691 a(n) = 2*C(0,n) -C(1,n) +2*sin(2*Pi*(n-1)/3)*floor((2*n-1)/3)/sqrt(3). [Sign corrected by _M. F. Hasler_, May 01 2013]
%F A120691 a(0)=2, a(1)=-1, for n>0: a(3*n-1) = 2*n-1, a(3*n) = 1-2*n, a(3*n+1) = 0. - _M. F. Hasler_, May 01 2013
%F A120691 a(n) = - a(n-1) - a(n-2) + a(n-3) + a(n-4) + a(n-5) for n > 6. - _Chai Wah Wu_, Jul 27 2022
%F A120691 a(n) = 0 if n mod 3 = 1, a(n) = (2*n-1)/3 if n mod 3 = 2, a(n) = (3-2*n)/3 otherwise, with a(0) = 2, and a(1) = -1. - _G. C. Greubel_, Dec 28 2022
%t A120691 Join[{2},Differences[ContinuedFraction[E,120]]] (* or *) LinearRecurrence[{-1,-1,1,1,1},{2,-1,1,-1,0,3,-3},120] (* _Harvey P. Dale_, Jun 08 2016 *)
%o A120691 (PARI) A120691(n)={n<2 && return(2-3*n); n=divrem(n-1,3); if(n[2],-(1+n[1]*2)*(-1)^n[2])} \\ - _M. F. Hasler_, May 01 2013
%o A120691 (Magma) R<x>:=PowerSeriesRing(Integers(), 70); Coefficients(R!( (1-x)*(2+x+2*x^2-3*x^3-x^4+x^6)/(1-x^3)^2 )); // _G. C. Greubel_, Dec 28 2022
%o A120691 (SageMath)
%o A120691 def b(n):
%o A120691     if (n%3==1): return 0
%o A120691     elif (n%3==2): return (2*n-1)/3
%o A120691     else: return (3-2*n)/3
%o A120691 def A120691(n): return b(n) + (-1)^n*int(n<2)
%o A120691 [A120691(n) for n in range(71)] # _G. C. Greubel_, Dec 28 2022
%Y A120691 Cf. A003417, A102899.
%K A120691 easy,sign
%O A120691 0,1
%A A120691 _Paul Barry_, Jun 27 2006