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.

A019425 Continued fraction for tan(1/2).

Original entry on oeis.org

0, 1, 1, 4, 1, 8, 1, 12, 1, 16, 1, 20, 1, 24, 1, 28, 1, 32, 1, 36, 1, 40, 1, 44, 1, 48, 1, 52, 1, 56, 1, 60, 1, 64, 1, 68, 1, 72, 1, 76, 1, 80, 1, 84, 1, 88, 1, 92, 1, 96, 1, 100, 1, 104, 1, 108, 1, 112, 1, 116, 1, 120, 1, 124, 1, 128, 1, 132, 1, 136, 1, 140, 1, 144, 1, 148, 1, 152, 1, 156, 1
Offset: 0

Views

Author

Keywords

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)

Examples

			0.546302489843790513255179465... = 0 + 1/(1 + 1/(1 + 1/(4 + 1/(1 + ...)))). - _Harry J. Smith_, Jun 13 2009
		

Crossrefs

Cf. A161011 (decimal expansion). Cf. A019426 through A019433.

Programs

  • 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
  • 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 *)
  • 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
    

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)

A053988 Denominators of successive convergents to tan(1/2) using continued fraction 1/(2-1/(6-1/(10-1/(14-1/(18-1/(22-1/(26-1/30-...))))))).

Original entry on oeis.org

2, 11, 108, 1501, 26910, 590519, 15326584, 459207001, 15597711450, 592253828099, 24859063068708, 1142924647332469, 57121373303554742, 3083411233744623599, 178780730183884614000, 11081321860167101444401, 731188462040844810716466, 51172111020998969648708219
Offset: 1

Views

Author

Vladeta Jovovic, Apr 03 2000

Keywords

Crossrefs

Cf. A001497, A053987 (numerators), A161011 (tan(1/2)).

Programs

  • Magma
    [(&+[ (-1)^k*Factorial(2*n-2*k)/(Factorial(n-2*k)*Factorial(2*k)): k in [0..Floor(n/2)]] ): n in [1..20]]; // G. C. Greubel, May 13 2020
    
  • Maple
    a:= n -> add((-1)^k*(2*n-2*k)!/((n-2*k)!*(2*k)!), k = 0..floor(n/2));
    seq(a(n), n = 1..20); # G. C. Greubel, May 13 2020
  • Mathematica
    Table[Sum[(-1)^k*(2*n-2*k)!/((n-2*k)!*(2*k)!), {k,0,Floor[n/2]}], {n, 20}] (* G. C. Greubel, May 13 2020 *)
  • PARI
    a(n)=sum(k=0,floor(n/2),(-1)^k*(2*n-2*k)!/(n-2*k)!/(2*k)!) \\ Benoit Cloitre, Jan 03 2006
    
  • Sage
    [sum((-1)^k*factorial(2*n-2*k)/(factorial(n-2*k)*factorial(2*k)) for k in (0..floor(n/2))) for n in (1..20)] # G. C. Greubel, May 13 2020

Formula

a(n) = Sum_{k=0..floor(n/2)} (-1)^k*(2*n-2*k)!/((n-2*k)!*(2*k)!) - Benoit Cloitre, Jan 03 2006
From G. C. Greubel, May 13 2020: (Start)
E.g.f.: cos((1 - sqrt(1-4*x))/2)/sqrt(1-4*x) - 1.
a(n) = 2*(2*n-1)*a(n-1) - a(n-2).
a(n) = ((-i)^n/2)*(y(n, 2*i) + (-1)^n*y(n, -2*i)), where y(n, x) are the Bessel Polynomials. (End)
a(n) ~ cos(1/2) * 2^(2*n + 1/2) * n^n / exp(n). - Vaclav Kotesovec, May 14 2020

Extensions

More terms from G. C. Greubel, May 13 2020

A161559 Engel expansion of tan(1/2).

Original entry on oeis.org

2, 11, 54, 136, 1473, 3483, 36244, 41086, 305728, 379955, 582669, 4540387, 5020443, 22096761, 24228660, 48364856, 178868536, 234516235, 524137295, 1096104266, 11627672572, 19828856452, 31372689367, 47247829739, 701124643395
Offset: 1

Views

Author

Keywords

Examples

			A161011 = 0.546302.... = 1/2+1/(2*11)+1/(2*11*54)+1/(2*11*54*136)+ ...
		

Crossrefs

Cf. A006784.

Programs

  • Mathematica
    EngelExp[A_,n_]:=Join[Array[1&,Floor[A]],First@Transpose@NestList[{Ceiling[1/ Expand[ #[[1]]#[[2]]-1]],Expand[ #[[1]]#[[2]]-1]}&,{Ceiling[1/(A-Floor[A])], A-Floor[A]},n-1]]; EngelExp[N[Tan[1/2],6! ],50]

Extensions

Example added by R. J. Mathar, Oct 04 2009
Showing 1-3 of 3 results.