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-6 of 6 results.

A002530 a(n) = 4*a(n-2) - a(n-4) for n > 1, a(n) = n for n = 0, 1.

Original entry on oeis.org

0, 1, 1, 3, 4, 11, 15, 41, 56, 153, 209, 571, 780, 2131, 2911, 7953, 10864, 29681, 40545, 110771, 151316, 413403, 564719, 1542841, 2107560, 5757961, 7865521, 21489003, 29354524, 80198051, 109552575, 299303201, 408855776, 1117014753, 1525870529, 4168755811
Offset: 0

Views

Author

Keywords

Comments

Denominators of continued fraction convergents to sqrt(3), for n >= 1.
Also denominators of continued fraction convergents to sqrt(3) - 1. See A048788 for numerators. - N. J. A. Sloane, Dec 17 2007. Convergents are 1, 2/3, 3/4, 8/11, 11/15, 30/41, 41/56, 112/153, ...
Consider the mapping f(a/b) = (a + 3*b)/(a + b). Taking a = b = 1 to start with and carrying out this mapping repeatedly on each new (reduced) rational number gives the following sequence 1/1, 2/1, 5/3, 7/4, 19/11, ... converging to 3^(1/2). Sequence contains the denominators. The same mapping for N, i.e., f(a/b) = (a + Nb)/(a + b) gives fractions converging to N^(1/2). - Amarnath Murthy, Mar 22 2003
Sqrt(3) = 2/2 + 2/3 + 2/(3*11) + 2/(11*41) + 2/(41*153) + 2/(153*571), ...; the sum of the first 6 terms of this series = 1.7320490367..., while sqrt(3) = 1.7320508075... - Gary W. Adamson, Dec 15 2007
From Clark Kimberling, Aug 27 2008: (Start)
Related convergents (numerator/denominator):
lower principal convergents: A001834/A001835
upper principal convergents: A001075/A001353
intermediate convergents: A005320/A001075
principal and intermediate convergents: A143642/A140827
lower principal and intermediate convergents: A143643/A005246. (End)
Row sums of triangle A152063 = (1, 3, 4, 11, ...). - Gary W. Adamson, Nov 26 2008
From Alois P. Heinz, Apr 13 2011: (Start)
Also number of domino tilings of the 3 X (n-1) rectangle with upper left corner removed iff n is even. For n=4 the 4 domino tilings of the 3 X 3 rectangle with upper left corner removed are:
. ._. . ._. . ._. . ._.
.|__| .|__| .| | | .|___|
| |_| | | | | | ||| |_| |
||__| |||_| ||__| |_|_| (End)
This is the sequence of Lehmer numbers u_n(sqrt(R),Q) with the parameters R = 2 and Q = -1. It is a strong divisibility sequence, that is, gcd(a(n),a(m)) = a(gcd(n,m)) for all natural numbers n and m. - Peter Bala, Apr 18 2014
2^(-floor(n/2))*(1 + sqrt(3))^n = A002531(n) + a(n)*sqrt(3); integers in the real quadratic number field Q(sqrt(3)). - Wolfdieter Lang, Feb 11 2018
Let T(n) = 2^(n mod 2), U(n) = a(n), V(n) = A002531(n), x(n) = V(n)/U(n). Then T(n*m) * U(n+m) = U(n)*V(m) + U(m)*V(n), T(n*m) * V(n+m) = 3*U(n)*U(m) + V(m)*V(n), x(n+m) = (3 + x(n)*x(m))/(x(n) + x(m)). - Michael Somos, Nov 29 2022

Examples

			Convergents to sqrt(3) are: 1, 2, 5/3, 7/4, 19/11, 26/15, 71/41, 97/56, 265/153, 362/209, 989/571, 1351/780, 3691/2131, ... = A002531/A002530 for n >= 1.
1 + 1/(1 + 1/(2 + 1/(1 + 1/2))) = 19/11 so a(5) = 11.
G.f. = x + x^2 + 3*x^3 + 4*x^4 + 11*x^5 + 15*x^6 + 41*x^7 + ... - _Michael Somos_, Mar 18 2022
		

References

  • Serge Lang, Introduction to Diophantine Approximations, Addison-Wesley, New York, 1966.
  • Russell Lyons, A bird's-eye view of uniform spanning trees and forests, in Microsurveys in Discrete Probability, AMS, 1998.
  • I. Niven and H. S. Zuckerman, An Introduction to the Theory of Numbers. 2nd ed., Wiley, NY, 1966, p. 181.
  • Murat Sahin and Elif Tan, Conditional (strong) divisibility sequences, Fib. Q., 56 (No. 1, 2018), 18-31.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • A. Tarn, Approximations to certain square roots and the series of numbers connected therewith, Mathematical Questions and Solutions from the Educational Times, 1 (1916), 8-12.

Crossrefs

Cf. A002531 (numerators of convergents to sqrt(3)), A048788, A003297.
Bisections: A001353 and A001835.
Cf. A152063.
Analog for sqrt(m): A000129 (m=2), A001076 (m=5), A041007 (m=6), A041009 (m=7), A041011 (m=8), A005668 (m=10), A041015 (m=11), A041017 (m=12), ..., A042935 (m=999), A042937 (m=1000).

Programs

  • Magma
    I:=[0,1,1,3]; [n le 4 select I[n] else 4*Self(n-2) - Self(n-4): n in [1..50]]; // G. C. Greubel, Feb 25 2019
    
  • Maple
    a := proc(n) option remember; if n=0 then 0 elif n=1 then 1 elif n=2 then 1 elif n=3 then 3 else 4*a(n-2)-a(n-4) fi end; [ seq(a(i),i=0..50) ];
    A002530:=-(-1-z+z**2)/(1-4*z**2+z**4); # conjectured (correctly) by Simon Plouffe in his 1992 dissertation
  • Mathematica
    Join[{0},Table[Denominator[FromContinuedFraction[ContinuedFraction[Sqrt[3],n]]], {n,1,50}]] (* Stefan Steinerberger, Apr 01 2006 *)
    Join[{0},Denominator[Convergents[Sqrt[3],50]]] (* or *) LinearRecurrence[ {0,4,0,-1},{0,1,1,3},50] (* Harvey P. Dale, Jan 29 2013 *)
    a[ n_] := If[n<0, -(-1)^n, 1] SeriesCoefficient[ x*(1+x-x^2)/(1-4*x^2+x^4), {x, 0, Abs@n}]; (* Michael Somos, Apr 18 2019 *)
    a[ n_] := ChebyshevU[n-1, Sqrt[-1/2]]*Sqrt[2]^(Mod[n, 2]-1)/I^(n-1) //Simplify; (* Michael Somos, Nov 29 2022 *)
  • PARI
    {a(n) = if( n<0, -(-1)^n * a(-n), contfracpnqn(vector(n, i, 1 + (i>1) * (i%2)))[2, 1])}; /* Michael Somos, Jun 05 2003 */
    
  • PARI
    { for (n=0, 50, a=contfracpnqn(vector(n, i, 1+(i>1)*(i%2)))[2, 1]; write("b002530.txt", n, " ", a); ); } \\ Harry J. Smith, Jun 01 2009
    
  • PARI
    my(w=quadgen(12)); A002530(n)=real((2+w)^(n\/2)*if(bittest(n,0),1-w/3,w/3));
    apply(A002530, [0..30]) \\ M. F. Hasler, Nov 04 2019
    
  • Python
    from functools import cache
    @cache
    def a(n): return [0, 1, 1, 3][n] if n < 4 else 4*a(n-2) - a(n-4)
    print([a(n) for n in range(36)]) # Michael S. Branicky, Nov 13 2022
  • Sage
    (x*(1+x-x^2)/(1-4*x^2+x^4)).series(x, 50).coefficients(x, sparse=False) # G. C. Greubel, Feb 25 2019
    

Formula

G.f.: x*(1 + x - x^2)/(1 - 4*x^2 + x^4).
a(n) = 4*a(n-2) - a(n-4). [Corrected by László Szalay, Feb 21 2014]
a(n) = -(-1)^n * a(-n) for all n in Z, would satisfy the same recurrence relation. - Michael Somos, Jun 05 2003
a(2*n) = a(2*n-1) + a(2*n-2), a(2*n+1) = 2*a(2*n) + a(2*n-1).
From Benoit Cloitre, Dec 15 2002: (Start)
a(2*n) = ((2 + sqrt(3))^n - (2 - sqrt(3))^n)/(2*sqrt(3)).
a(2*n) = A001353(n).
a(2*n-1) = ceiling((1 + 1/sqrt(3))/2*(2 + sqrt(3))^n) = ((3 + sqrt(3))^(2*n - 1) + (3 - sqrt(3))^(2*n - 1))/6^n.
a(2*n-1) = A001835(n). (End)
a(n+1) = Sum_{k=0..floor(n/2)} binomial(n - k, k) * 2^floor((n - 2*k)/2). - Paul Barry, Jul 13 2004
a(n) = Sum_{k=0..floor(n/2)} binomial(floor(n/2) + k, floor((n - 1)/2 - k))*2^k. - Paul Barry, Jun 22 2005
G.f.: (sqrt(6) + sqrt(3))/12*Q(0), where Q(k) = 1 - a/(1 + 1/(b^(2*k) - 1 - b^(2*k)/(c + 2*a*x/(2*x - g*m^(2*k)/(1 + a/(1 - 1/(b^(2*k + 1) + 1 - b^(2*k + 1)/(h - 2*a*x/(2*x + g*m^(2*k + 1)/Q(k + 1)))))))))). - Sergei N. Gladkovskii, Jun 21 2012
a(n) = (alpha^n - beta^n)/(alpha - beta) for n odd, and a(n) = (alpha^n - beta^n)/(alpha^2 - beta^2) for n even, where alpha = 1/2*(sqrt(2) + sqrt(6)) and beta = (1/2)*(sqrt(2) - sqrt(6)). Cf. A108412. - Peter Bala, Apr 18 2014
a(n) = (-sqrt(2)*i)^n*S(n, sqrt(2)*i)*2^(-floor(n/2)) = A002605(n)*2^(-floor(n/2)), n >= 0, with i = sqrt(-1) and S the Chebyshev polynomials (A049310). - Wolfdieter Lang, Feb 10 2018
a(n+1)*a(n+2) - a(n+3)*a(n) = (-1)^n, n >= 0. - Kai Wang, Feb 06 2020
E.g.f.: sinh(sqrt(3/2)*x)*(sinh(x/sqrt(2)) + sqrt(2)*cosh(x/sqrt(2)))/sqrt(3). - Stefano Spezia, Feb 07 2020
a(n) = ((1 + sqrt(3))^n - (1 - sqrt(3))^n)/(2*2^floor(n/2))/sqrt(3) = A002605(n)/2^floor(n/2). - Robert FERREOL, Apr 13 2023

Extensions

Definition edited by M. F. Hasler, Nov 04 2019

A010465 Decimal expansion of square root of 7.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Continued fraction expansion is 2 followed by {1, 1, 1, 4} repeated. - Harry J. Smith, Jun 01 2009
The convergents to sqrt(7) are given in A041008/A041009. - Wolfdieter Lang, Nov 22 2017

Examples

			2.645751311064590590501615753639260425710259183082450180368334459201...
		

Crossrefs

Cf. A010121 (continued fraction), A041008/A041009.

Programs

  • Magma
    SetDefaultRealField(RealField(100)); Sqrt(7); // Vincenzo Librandi, Feb 15 2020
  • Mathematica
    RealDigits[N[Sqrt[7], 200]][[1]] (* Vladimir Joseph Stephan Orlovsky, Feb 21 2011 *)
  • PARI
    default(realprecision, 20080); x=sqrt(7); for (n=1, 20000, d=floor(x); x=(x-d)*10; write("b010465.txt", n, " ", d));  \\ Harry J. Smith, Jun 01 2009
    

Formula

Equals 8*cos(Pi/14)*sin(2*Pi/14)*cos(3*Pi/14). - Gerry Martens, Mar 13 2025

A041008 Numerators of continued fraction convergents to sqrt(7).

Original entry on oeis.org

2, 3, 5, 8, 37, 45, 82, 127, 590, 717, 1307, 2024, 9403, 11427, 20830, 32257, 149858, 182115, 331973, 514088, 2388325, 2902413, 5290738, 8193151, 38063342, 46256493, 84319835, 130576328, 606625147, 737201475, 1343826622, 2081028097, 9667939010, 11748967107, 21416906117
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A010465, A041009 (denominators), A266698 (quadrisection), A001081 (quadrisection).
Analog for other sqrt(m): A001333 (m=2), A002531 (m=3), A001077 (m=5), A041006 (m=6), A041010 (m=8), A005667 (m=10), A041014 (m=11), A041016 (m=12), ..., A042934 (m=999), A042936 (m=1000).

Programs

  • Mathematica
    Table[Numerator[FromContinuedFraction[ContinuedFraction[Sqrt[7],n]]],{n,1,50}] (* Vladimir Joseph Stephan Orlovsky, Mar 16 2011 *)
    Numerator[Convergents[Sqrt[7], 30]] (* Vincenzo Librandi, Oct 28 2013 *)
    LinearRecurrence[{0,0,0,16,0,0,0,-1},{2,3,5,8,37,45,82,127},40] (* Harvey P. Dale, Jul 23 2021 *)
  • PARI
    A041008=contfracpnqn(c=contfrac(sqrt(7)),#c)[1,][^-1] \\ Discard possibly incorrect last element. NB: a(n)=A041008[n+1]! For more terms use:
    A041008(n)={n<#A041008|| A041008=extend(A041008, [4, 16; 8, -1], n\.8); A041008[n+1]}
    extend(A,c,N)={for(n=#A+1, #A=Vec(A, N), A[n]=[A[n-i]|i<-c[,1]]*c[,2]); A} \\ (End)

Formula

G.f.: (2 + 3*x + 5*x^2 + 8*x^3 + 5*x^4 - 3*x^5 + 2*x^6 - x^7)/(1 - 16*x^4 + x^8).

A042937 Denominators of continued fraction convergents to sqrt(1000).

Original entry on oeis.org

1, 1, 2, 3, 5, 8, 53, 114, 281, 4329, 8939, 22207, 142181, 164388, 306569, 470957, 777526, 1248483, 78183472, 79431955, 157615427, 237047382, 394662809, 631710191, 4184923955, 9001558101, 22188040157, 341822160456, 705832361069, 1753486882594
Offset: 0

Views

Author

Keywords

Examples

			sqrt(1000) = 31.62... = 31 + 1/(1 + 1/(1 + ...)) with convergents 31/1, 32/1, 63/2, 95/3, 158/5, ... - _M. F. Hasler_, Nov 02 2019
		

Crossrefs

Cf. A042936 (numerators), A040968 (continued fraction), A010467 (decimals).
Analog for sqrt(m): A000129 (m=2), A002530 (m=3), A001076 (m=5), A041007 (m=6), A041009 (m=7), A041011 (m=8), A005663 (m=10), A041015 (m=11), A041017 (m=12), ..., A042933 (m=998), A042935 (m=999).

Programs

  • Mathematica
    Denominator[Convergents[Sqrt[1000], 30]] (* Vincenzo Librandi, Feb 01 2014 *)
  • PARI
    A42937=contfracpnqn(c=contfrac(sqrt(1000)),#c-1)[2,] \\ Possibly incorrect last term ignored. NB: a(n) = A42937[n+1]. For more terms use e.g. \p999, or compute any a(n) from this as in A042936. - M. F. Hasler, Nov 01 2019

Extensions

More terms from Vincenzo Librandi, Feb 01 2014

A259596 Denominators of the other-side convergents to sqrt(7).

Original entry on oeis.org

1, 2, 3, 5, 17, 31, 48, 79, 271, 494, 765, 1259, 4319, 7873, 12192, 20065, 68833, 125474, 194307, 319781, 1097009, 1999711, 3096720, 5096431, 17483311, 31869902, 49353213, 81223115, 278635967, 507918721, 786554688, 1294473409, 4440692161, 8094829634
Offset: 0

Views

Author

Clark Kimberling, Jul 20 2015

Keywords

Comments

Suppose that a positive irrational number r has continued fraction [a(0), a(1), ... ]. Define sequences p(i), q(i), P(i), Q(i) from the numerators and denominators of finite continued fractions as follows:
p(i)/q(i) = [a(0), a(1), ... a(i)] and P(i)/Q(i) = [a(0), a(1), ..., a(i) + 1]. The fractions p(i)/q(i) are the convergents to r, and the fractions P(i)/Q(i) are introduced here as the "other-side convergents" to
r, because p(2k)/q(2k) < r < P(2k)/Q(2k) and P(2k+1)/Q(2k+1) < r < p(2k+1)/q(2k+1), for k >= 0. The closeness of P(i)/Q(i) to r is indicated by |r - P(i)/Q(i)| < |p(i)/q(i) - P(i)/Q(i)| = 1/(q(i)Q(i)), for i >= 0.

Examples

			For r = sqrt(7), 3, 5/2, 8/3, 13/5, 45/17, 82/31, 127/48. A comparison of convergents with other-side convergents:
i    p(i)/q(i)         P(i)/Q(i)    p(i)*Q(i)-P(i)*q(i)
0    2/1   < sqrt(7) <    3/1               -1
1    3/1   > sqrt(7) >    5/2                1
2    5/2   < sqrt(7) <    8/3               -1
3    8/3   > sqrt(7) >   13/5                1
4    37/14 < sqrt(7) <   45/17              -1
5    45/17 > sqrt(7) >   83/31               1
		

Crossrefs

Cf. A041008, A041009, A259597 (numerators).

Programs

  • Mathematica
    r = Sqrt[7]; a[i_] := Take[ContinuedFraction[r, 35], i];
    b[i_] := ReplacePart[a[i], i -> Last[a[i]] + 1];
    t = Table[FromContinuedFraction[b[i]], {i, 1, 35}]
    u = Denominator[t]
    LinearRecurrence[{0,0,0,16,0,0,0,-1},{1,2,3,5,17,31,48,79},40] (* Harvey P. Dale, Jun 03 2017 *)
  • PARI
    Vec(-(x+1)*(x^2-x-1)*(x^4+3*x^2+1)/(x^8-16*x^4+1) + O(x^50)) \\ Colin Barker, Jul 21 2015

Formula

p(i)*Q(i) - P(i)*q(i) = (-1)^(i+1), for i >= 0, where a(i) = Q(i).
a(n) = 16*a(n-4) - a(n-8) for n>7. - Colin Barker, Jul 21 2015
G.f.: -(x+1)*(x^2-x-1)*(x^4+3*x^2+1) / (x^8-16*x^4+1). - Colin Barker, Jul 21 2015

A259597 Numerators of the other-side convergents to sqrt(7).

Original entry on oeis.org

3, 5, 8, 13, 45, 82, 127, 209, 717, 1307, 2024, 3331, 11427, 20830, 32257, 53087, 182115, 331973, 514088, 846061, 2902413, 5290738, 8193151, 13483889, 46256493, 84319835, 130576328, 214896163, 737201475, 1343826622, 2081028097, 3424854719, 11748967107
Offset: 0

Views

Author

Clark Kimberling, Jul 20 2015

Keywords

Comments

Suppose that a positive irrational number r has continued fraction [a(0), a(1), ... ]. Define sequences p(i), q(i), P(i), Q(i) from the numerators and denominators of finite continued fractions as follows:
p(i)/q(i) = [a(0), a(1), ... a(i)] and P(i)/Q(i) = [a(0), a(1), ..., a(i) + 1]. The fractions p(i)/q(i) are the convergents to r, and the fractions P(i)/Q(i) are introduced here as the "other-side convergents" to
r, because p(2k)/q(2k) < r < P(2k)/Q(2k) and P(2k+1)/Q(2k+1) < r < p(2k+1)/q(2k+1), for k >= 0. The closeness of P(i)/Q(i) to r is indicated by |r - P(i)/Q(i)| < |p(i)/q(i) - P(i)/Q(i)| = 1/(q(i)Q(i)), for i >= 0.

Examples

			For r = sqrt(7), 3, 5/2, 8/3, 13/5, 45/17, 82/31, 127/48. A comparison of convergents with other-side convergents:
i  p(i)/q(i)            P(i)/Q(i)    p(i)*Q(i)-P(i)*q(i)
0     2/1   < sqrt(7) <    3/1               -1
1     3/1   > sqrt(7) >    5/2                1
2     5/2   < sqrt(7) <    8/3               -1
3     8/3   > sqrt(7) >   13/5                1
4     37/14 < sqrt(7) <   45/17              -1
5     45/17 > sqrt(7) >   83/31               1
		

Crossrefs

Cf. A041008, A041009, A259596 (denominators).

Programs

  • Mathematica
    r = Sqrt[7]; a[i_] := Take[ContinuedFraction[r, 35], i];
    b[i_] := ReplacePart[a[i], i -> Last[a[i]] + 1];
    t = Table[FromContinuedFraction[b[i]], {i, 1, 35}]
    v = Numerator[t]
    LinearRecurrence[{0,0,0,16,0,0,0,-1},{3,5,8,13,45,82,127,209},40] (* Harvey P. Dale, Jan 15 2017 *)
  • PARI
    Vec((x^7-x^6+2*x^5-3*x^4+13*x^3+8*x^2+5*x+3)/(x^8-16*x^4+1) + O(x^50)) \\ Colin Barker, Jul 21 2015

Formula

p(i)*Q(i) - P(i)*q(i) = (-1)^(i+1), for i >= 0, where a(i) = Q(i).
a(n) = 16*a(n-4) - a(n-8) for n>7. - Colin Barker, Jul 21 2015
G.f.: (x^7-x^6+2*x^5-3*x^4+13*x^3+8*x^2+5*x+3) / (x^8-16*x^4+1). - Colin Barker, Jul 21 2015
Showing 1-6 of 6 results.