OFFSET
0,4
COMMENTS
From Peter Bala, Nov 17 2019: (Start)
The simple continued fraction expansion for tan(1/2) may be derived by setting z = 1/2 in Lambert's continued fraction tan(z) = z/(1 - z^2/(3 - z^2/(5 - ... ))) and, after using an equivalence transformation, making repeated use of the identity 1/(n - 1/m) = 1/((n - 1) + 1/(1 + 1/(m - 1))).
The same approach produces the simple continued fraction expansions for the numbers tan(1/n), n*tan(1/n) and 1/n*tan(1/n) for n = 1,2,3,.... [added Oct 03 2023: and, even more generally, the simple continued fraction expansions for the numbers d*tan(1/n) and 1/d*tan(1/n), where d divides n. See A019429 for an example]. (End)
LINKS
Harry J. Smith, Table of n, a(n) for n = 0..20000
Dan Romik, The dynamics of Pythagorean Triples, Trans. Amer. Math. Soc. 360 (2008), 6045-6064.
G. Xiao, Contfrac
Index entries for linear recurrences with constant coefficients, signature (0, 2, 0, -1).
FORMULA
a(n) = n - 1/2 - (n-3/2)*(-1)^n + binomial(1,n) - 2*binomial(0,n). - Paul Barry, Oct 25 2007
From Philippe Deléham, Feb 10 2009: (Start)
a(n) = 2*a(n-2) - a(n-4), n>=6.
G.f.: (x + x^2 + 2*x^3 - x^4 + x^5)/(1-x^2)^2. (End)
From Peter Bala, Nov 17 2019; (Start)
Related simple continued fraction expansions:
2*tan(1/2) = [1, 10, 1, 3, 1, 26, 1, 7, 1, 42, 1, 11, 1, 58, 1, 15, 1, 74, 1, 19, 1, 90, ...]
(1/2)*tan(1/2) = [0; 3, 1, 1, 1, 18, 1, 5, 1, 34, 1, 9, 1, 50, 1, 13, 1, 66, 1, 17, 1, 82, ...]. (End)
EXAMPLE
0.546302489843790513255179465... = 0 + 1/(1 + 1/(1 + 1/(4 + 1/(1 + ...)))). - Harry J. Smith, Jun 13 2009
MAPLE
a := n -> if n < 2 then n else ifelse(irem(n, 2) = 0, 1, 2*n - 2) fi:
seq(a(n), n = 0..80); # Peter Luschny, Oct 03 2023
MATHEMATICA
Join[{0, 1}, LinearRecurrence[{0, 2, 0, -1}, {1, 4, 1, 8}, 100]] (* Vincenzo Librandi, Jan 03 2016 *)
PROG
(PARI) { allocatemem(932245000); default(realprecision, 85000); x=contfrac(tan(1/2)); for (n=0, 20000, write("b019425.txt", n, " ", x[n+1])); } \\ Harry J. Smith, Jun 13 2009
(Magma) [0, 1] cat [n-1/2-(n-3/2)*(-1)^n+Binomial(1, n)- 2*Binomial(0, n): n in [2..80]]; // Vincenzo Librandi, Jan 03 2016
CROSSREFS
KEYWORD
nonn,cofr
AUTHOR
STATUS
approved