A228935 a(n) = (3 - 6*n)*(-1)^n.
0, 3, -9, 15, -21, 27, -33, 39, -45, 51, -57, 63, -69, 75, -81, 87, -93, 99, -105, 111, -117, 123, -129, 135, -141, 147, -153, 159, -165, 171, -177, 183, -189, 195, -201, 207, -213, 219, -225, 231, -237, 243, -249, 255, -261, 267, -273, 279, -285, 291
Offset: 0
Examples
tan(1/3) = 0 + 1/(3 + 1/(-9 + 1/(15 + 1/(-21 + 1/(27 + ...))))) or tan(1/3) = 0 + 1/(3 - 1/(9 - 1/(15 - 1/(21 - 1/(27 - ...))))).
Links
- Index entries for linear recurrences with constant coefficients, signature (-2,-1).
Programs
-
Maple
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 SCF(tan(1/3), 50) # Giovanni Artico, Oct 26 2013
-
Mathematica
Join[{0},LinearRecurrence[{-2,-1},{3,-9},50]] (* Harvey P. Dale, Mar 10 2015 *)
-
PARI
Vec(3*x*(1-x)/(x+1)^2+O(x^100)) \\ Colin Barker, Oct 26 2013
Formula
a(n) = A016945(n-1)*(-1)^(n-1).
Formulae for the general case tan(1/k):
a(0)=0; for n > 0, a(n) = (-1)^(n+1)*k*(2n-1).
tan(1/k) = 1/(k + 1/(-3k + 1/(5k - 1/(-7k + 1/(9k + 1/...))))) or equivalently
tan(1/k) = 1/(k - 1/(3k - 1/(5k - 1/(7k - 1/(9k - 1/...))))).
From Colin Barker, Oct 26 2013: (Start)
a(n) = -2*a(n-1) - a(n-2) for n > 2.
G.f.: 3*x*(1-x) / (x+1)^2. (End)
Comments