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.

A228935 a(n) = (3 - 6*n)*(-1)^n.

This page as a plain text file.
%I A228935 #35 Feb 10 2024 12:18:02
%S A228935 0,3,-9,15,-21,27,-33,39,-45,51,-57,63,-69,75,-81,87,-93,99,-105,111,
%T A228935 -117,123,-129,135,-141,147,-153,159,-165,171,-177,183,-189,195,-201,
%U A228935 207,-213,219,-225,231,-237,243,-249,255,-261,267,-273,279,-285,291
%N A228935 a(n) = (3 - 6*n)*(-1)^n.
%C A228935 Optimal simple continued fraction (with signed denominators) of tan(1/3).
%C A228935 This expansion is a simple continued fraction a(0) + 1/(a(1) + 1/(a(2) + ...)) with all numerators 1, and the numbers a(n) are signed integers computed with an algorithm that guarantees the fastest convergence for this type of continued fraction.
%C A228935 The algorithm is the same described in A133593. It is as usually based on the Euclidean division algorithm, but instead of taking the floor of the quotients, as it happens for standard continued fractions, the nearest integer is taken, so the remainders can be also negative and the quotients also.
%C A228935 Generally the convergents of this expansion are a subset of the convergents of the standard continued fraction expansion, and they are no more alternatively lesser and greater than the given number: in this special case of tan(1/3) they are all lesser.
%C A228935 The terms of this sequence can be generated by this formula: a(n) = -3*(-1)^n*(2n-1) for n > 0 (the first term is a(0)=0).
%C A228935 Repeating the expansion for other numbers of type 1/k a common pattern seems to emerge. Examples:
%C A228935 tan(1/4) gives 0, 4, -12, 20, -28, 36, -44, 52, -60, 68, -76, 84, ...
%C A228935 tan(1/5) gives 0, 5, -15, 25, -35, 45, -55, 65, -75, 85, -95, 105, ...
%C A228935 so it seems that in general the terms of tan(1/k) are generated by the formula a(n) = (-1)^(n+1)*k*(2n-1) for n > 0. This formula gives this expansion for tan(1/k):
%C A228935 tan(1/k) = 1/(k+1/(-3k+1/(5k-1/(-7k+1/(9k+1/...))))).
%C A228935 This expansion can be rewritten in an equivalent form:
%C A228935 tan(1/k) = 1/(k-1/(3k-1/(5k-1/(7k-1/(9k-1/...))))).
%C A228935 The rule for converting the first form to the second is this: if two consecutive terms have different sign put a minus before the fraction line, otherwise put plus, and take the absolute value of the terms in the denominators.
%C A228935 This general expansion seems to be valid for any real value of k and resembles Lambert's expansion of tan(k).
%C A228935 The unsigned version of this sequence is A016945. - _Colin Barker_, Oct 26 2013
%H A228935 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (-2,-1).
%F A228935 a(n) = A016945(n-1)*(-1)^(n-1).
%F A228935 Formulae for the general case tan(1/k):
%F A228935 a(0)=0; for n > 0, a(n) = (-1)^(n+1)*k*(2n-1).
%F A228935 tan(1/k) = 1/(k + 1/(-3k + 1/(5k - 1/(-7k + 1/(9k + 1/...))))) or equivalently
%F A228935 tan(1/k) = 1/(k - 1/(3k - 1/(5k - 1/(7k - 1/(9k - 1/...))))).
%F A228935 From _Colin Barker_, Oct 26 2013: (Start)
%F A228935 a(n) = -2*a(n-1) - a(n-2) for n > 2.
%F A228935 G.f.: 3*x*(1-x) / (x+1)^2. (End)
%e A228935 tan(1/3) = 0 + 1/(3 + 1/(-9 + 1/(15 + 1/(-21 + 1/(27 + ...))))) or
%e A228935 tan(1/3) = 0 + 1/(3 - 1/(9 - 1/(15 - 1/(21 - 1/(27 - ...))))).
%p A228935 SCF := 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 A228935 SCF(tan(1/3), 50)  # _Giovanni Artico_, Oct 26 2013
%t A228935 Join[{0},LinearRecurrence[{-2,-1},{3,-9},50]] (* _Harvey P. Dale_, Mar 10 2015 *)
%o A228935 (PARI) Vec(3*x*(1-x)/(x+1)^2+O(x^100)) \\ _Colin Barker_, Oct 26 2013
%Y A228935 Cf. A016945, A133593, A228936.
%K A228935 sign,cofr,easy
%O A228935 0,2
%A A228935 _Giovanni Artico_, Oct 25 2013