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-5 of 5 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)

A019429 Continued fraction for tan(1/6).

Original entry on oeis.org

0, 5, 1, 16, 1, 28, 1, 40, 1, 52, 1, 64, 1, 76, 1, 88, 1, 100, 1, 112, 1, 124, 1, 136, 1, 148, 1, 160, 1, 172, 1, 184, 1, 196, 1, 208, 1, 220, 1, 232, 1, 244, 1, 256, 1, 268, 1, 280, 1, 292, 1, 304, 1, 316, 1, 328, 1, 340, 1, 352, 1, 364, 1, 376, 1, 388, 1, 400, 1, 412, 1, 424, 1, 436, 1
Offset: 0

Views

Author

Keywords

Examples

			0.16822721830224246125721608... = 0 + 1/(5 + 1/(1 + 1/(16 + 1/(1 + ...)))). - _Harry J. Smith_, Jun 13 2009
		

Crossrefs

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

Programs

  • Mathematica
    Block[{$MaxExtraPrecision=1000},ContinuedFraction[Tan[1/6],100]] (* Harvey P. Dale, May 14 2014 *)
  • PARI
    { allocatemem(932245000); default(realprecision, 95000); x=contfrac(tan(1/6)); for (n=0, 20000, write("b019429.txt", n, " ", x[n+1])); } \\ Harry J. Smith, Jun 13 2009

Formula

Conjecture: a(n) = (-1+3*(-1)^n-6*(-1+(-1)^n)*n)/2 for n>1. a(n) = 2*a(n-2)-a(n-4) for n>5. G.f.: x*(x^4-x^3+6*x^2+x+5) / ((x-1)^2*(x+1)^2). - Colin Barker, May 28 2013
From Peter Bala, Nov 18 2019: (Start)
a(2*n) = 1 and a(2*n+1) = 12*n + 4, both for n >= 1.
The above conjectures are correct. The simple continued fraction expansion for tan(1/6) may be derived by setting z = 1/6 in Lambert's continued fraction tan(z) = z/(1 - z^2/(3 - z^2/(5 - ... ))) and then, after using an equivalence transformation, making repeated use of the identity 1/(n - 1/m) = 1/((n - 1) + 1/(1 + 1/(m - 1))).
A similar approach produces the related simple continued fraction expansions
2*tan(1/6) = [0, 2, 1, 34, 1, 13, 1, 82, 1, 25, 1, 130, 1, 37, 1, 178, 1, 49, ...], with denominators c(2*n) = 1, c(4*n+1) = 12*n + 1, both for n >= 1, and c(4*n+3) = 48*n + 34 for n >= 0;
3*tan(1/6) = [0; 1, 1, 52, 1, 8, 1, 124, 1, 16, 1, 196, 1, 24, 1, 268, 1, 32, ...];
6*tan(1/6) = [1; 106, 1, 3, 1, 250, 1, 7, 1, 394, 1, 11, 1, 538, 1, 15, 1, 682,..];
(1/2)*tan(1/6) = [0, 11, 1, 7, 1, 58, 1, 19, 1, 106, 1, 31, 1, 154, 1, 43, 1, ...];
(1/3)*tan(1/6) = [0, 17, 1, 4, 1, 88, 1, 12, 1, 160, 1, 20, 1, 232, 1, 28, 1, ...];
(1/6)*tan(1/6) = [0, 35, 1, 1, 1, 178, 1, 5, 1, 322, 1, 9, 1, 466, 1, 13, 1, ...];
(End)

A161012 Decimal expansion of tan(1/3).

Original entry on oeis.org

3, 4, 6, 2, 5, 3, 5, 4, 9, 5, 1, 0, 5, 7, 5, 4, 9, 1, 0, 3, 8, 5, 4, 3, 5, 6, 5, 6, 0, 9, 7, 4, 0, 7, 7, 4, 5, 9, 5, 7, 0, 3, 9, 1, 6, 1, 8, 9, 8, 0, 0, 2, 1, 7, 9, 7, 6, 4, 4, 4, 0, 6, 4, 8, 9, 8, 5, 9, 7, 6, 5, 7, 4, 9, 1, 5, 4, 7, 5, 5, 2, 8, 1, 5, 9, 6, 5, 7, 8, 7, 0, 0, 9, 3, 9, 7, 2, 6, 6, 9, 0, 5, 0, 4, 9
Offset: 0

Views

Author

Harry J. Smith, Jun 13 2009

Keywords

Comments

By the Lindemann-Weierstrass theorem, this constant is transcendental. - Charles R Greathouse IV, May 13 2019

Examples

			0.346253549510575491038543565609740774595703916189800217976444064898597...
		

Crossrefs

Cf. A019426 (continued fraction).

Programs

  • Mathematica
    RealDigits[Tan[1/3], 10, 120][[1]] (* Amiram Eldar, Jun 27 2023 *)
  • PARI
    default(realprecision, 20080); x=10*tan(1/3); for (n=0, 20000, d=floor(x); x=(x-d)*10; write("b161012.txt", n, " ", d));

A380013 Continued fraction expansion of Sum_{i>=0} (-1)^i/(q(i)*q(i+1)) where q(0)=q(1)=1, q(2n+2)=q(2n+1)+q(2n), and q(2n+3)=q(2n+1)*(q(2n+2)+1).

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 1, 18, 1, 432, 1, 196992, 1, 38895676416, 1, 1512881323731695591424, 1, 2288809899755012359448064967916189926490112, 1
Offset: 0

Views

Author

Khalil Ayadi, Jan 09 2025

Keywords

Comments

a(19) has 85 decimal digits and a(21) has 170 decimal digits.
This number is transcendental.
q(n) is the denominator of the convergent resulting from terms a(0..n).
The continued fraction is constructed by successively appending a pair of terms 1 and its own q(n) so far, so a(2*n) = 1 and a(2*n+1) = q(2*n-1) for n>=1
The series and the recurrence for q follows from that construction.
The series can also be written Sum_{i>=0} (-1)^i/x(i) where x(i) = q(i)*q(i+1) and in that case x(0)=1, x(2n+1) divides x(2n+2), and x(2n+3) = ((x(2n+2)/x(2n+1))*(x(2n)/x(2n-1))*...*(x(2)/x(1)))^2 + x(2n+2).

Examples

			0 + 1/(1 + 1/(1 + 1/(1 + ... ))) = 0.6087912199223083952132365...
		

Crossrefs

Programs

  • PARI
    Q(n) = {my(v=vector(n+1)); v[1]=v[2]=1; for(i=2, n, v[i+1] = if(i%2==0, v[i]+v[i-1], v[i-1]*(v[i]+1))); v}
    seq(n)=my(q=Q(max(2,n-2))); vector(n+1, n, if(n%2 || n<4, n>1, q[n-2])) \\ Andrew Howroyd, Jan 13 2025

A380194 Continued fraction expansion of Sum_{i>=0} (-1)^i/(q(i)*q(i+1)) where q(0)=q(1)=1, q(3n+2)=q(3n+1)+q(3n), q(3n+3)=q(3n+2)+q(3n+1), and q(3n+4)=q(3n+2)*(q(3n+2)*q(3n+3)+1).

Original entry on oeis.org

0, 1, 1, 1, 4, 1, 1, 289, 1, 1, 81126049, 1, 1, 2128359349797626142548649, 1, 1, 38565134716822109850786884343127955049217538196275147632486387905655060249, 1, 1
Offset: 0

Views

Author

Khalil Ayadi, Jan 15 2025

Keywords

Comments

This is a transcendental number.
The n-th convergent of a(0..n) has q(n) as denominator.
Thus a(3*n+2) = a(3*n+3)=1 and a(3*n+4) = q(3*n+2)^2 for n>=1 are the results of repeatedly appending a triple of terms 1,1,Q^2 where Q is the convergent denominator after the first new 1.
The recurrence for q follows from this construction, and the alternating series is the continued fraction value for any sequence of convergent denominators.
This structure leads to the series and the recurrence for q.
Sum_{i>=0} (-1)^i/x(i) is another way to write the series, where x(i) = q(i)*q(i+1). When x(0)=1 , x(3n+2) divides x(3n+3), x(3n+2)-x(3n+1)=((x(3n+1))/x(3n))*(x(3n-1)/x(3n-2))*(x(3n-3)/x(3n-4))...(x(2)/x(1)))^2,x(3n+4)-x(3n+3)=(x(3n+3)/x(3n+2))^2*(x(3n+2)-x(3n+1)).

Examples

			0 + 1/(1 + 1/(1 + 1/(1 + ... ))) = 0.645164877940276...
		

Crossrefs

Programs

  • PARI
    q(n) = if (n<=1, 1, if (n%3==1, q(n-2)*(q(n-2)*q(n-1)+1), q(n-1)+q(n-2)));
    a(n) = if (n==0, 0, if ((n%3)==1, q(n-2)^2, 1)); \\ Michel Marcus, Jan 17 2025
Showing 1-5 of 5 results.