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.

A002531 a(2*n) = a(2*n-1) + a(2*n-2), a(2*n+1) = 2*a(2*n) + a(2*n-1); a(0) = a(1) = 1.

Original entry on oeis.org

1, 1, 2, 5, 7, 19, 26, 71, 97, 265, 362, 989, 1351, 3691, 5042, 13775, 18817, 51409, 70226, 191861, 262087, 716035, 978122, 2672279, 3650401, 9973081, 13623482, 37220045, 50843527, 138907099, 189750626, 518408351, 708158977, 1934726305
Offset: 0

Views

Author

Keywords

Comments

Numerators of continued fraction convergents to sqrt(3), for n >= 1.
For the denominators see A002530.
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 convergents 1/1, 2/1, 5/3, 7/4, 19/11, ... converging to sqrt(3). Sequence contains the numerators. - Amarnath Murthy, Mar 22 2003
In the Murthy comment if we take a = 0, b = 1 then the denominator of the reduced fraction is a(n+1). A083336(n)/a(n+1) converges to sqrt(3). - Mario Catalani (mario.catalani(AT)unito.it), Apr 26 2003
If signs are disregarded, all terms of A002316 appear to be elements of this sequence. - Creighton Dement, Jun 11 2007
2^(-floor(n/2))*(1 + sqrt(3))^n = a(n) + A002530(n)*sqrt(3); integers in the real quadratic number field Q(sqrt(3)). - Wolfdieter Lang, Feb 10 2018
Let T(n) = A000034(n), U(n) = A002530(n), V(n) = a(n), x(n) = U(n)/V(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) = (x(n) + x(m))/(1 + 3*x(n)*x(m)). - Michael Somos, Nov 29 2022

Examples

			1 + 1/(1 + 1/(2 + 1/(1 + 1/2))) = 19/11 so a(5) = 19.
Convergents 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.
G.f. = 1 + x + 2*x^2 + 5*x^3 + 7*x^4 + 19*x^5 + 26*x^6 + 71*x^7 + ... - _Michael Somos_, Mar 22 2022
		

References

  • I. Niven and H. S. Zuckerman, An Introduction to the Theory of Numbers. 2nd ed., Wiley, NY, 1966, p. 181.
  • 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

Bisections are A001075 and A001834.
Cf. A002530 (denominators), A048788.
Cf. A002316.

Programs

  • GAP
    a:=[1,1,2,5];; for n in [5..40] do a[n]:=4*a[n-2]-a[n-4]; od; a; # G. C. Greubel, Nov 16 2018
  • Magma
    m:=40; R:=PowerSeriesRing(Integers(), m); Coefficients(R!( (1 +x-2*x^2+x^3)/(1-4*x^2+x^4))); // G. C. Greubel, Nov 16 2018
    
  • Maple
    A002531 := proc(n) option remember; if n=0 then 0 elif n=1 then 1 elif n=2 then 1 elif type(n,odd) then A002531(n-1)+A002531(n-2) else 2*A002531(n-1)+A002531(n-2) fi; end; [ seq(A002531(n), n=0..50) ];
    with(numtheory): tp := cfrac (tan(Pi/3),100): seq(nthnumer(tp,i), i=-1..32 ); # Zerinvary Lajos, Feb 07 2007
    A002531:=(1+z-2*z**2+z**3)/(1-4*z**2+z**4); # Simon Plouffe; see his 1992 dissertation
  • Mathematica
    Insert[Table[Numerator[FromContinuedFraction[ContinuedFraction[Sqrt[3], n]]], {n, 1, 40}], 1, 1] (* Stefan Steinerberger, Apr 01 2006 *)
    Join[{1},Numerator[Convergents[Sqrt[3],40]]] (* Harvey P. Dale, Jan 23 2012 *)
    CoefficientList[Series[(1 + x - 2 x^2 + x^3)/(1 - 4 x^2 + x^4), {x, 0, 30}], x] (* Vincenzo Librandi, Nov 01 2014 *)
    LinearRecurrence[{0, 4, 0, -1}, {1, 1, 2, 5}, 35] (* Robert G. Wilson v, Feb 11 2018 *)
    a[ n_] := ChebyshevT[n, Sqrt[-1/2]]*Sqrt[2]^Mod[n,2]/I^n //Simplify; (* Michael Somos, Mar 22 2022 *)
    a[ n_] := If[n<0, (-1)^n*a[-n], SeriesCoefficient[ (1 + x - 2*x^2 + x^3) / (1 - 4*x^2 + x^4), {x, 0, n}]]; (* Michael Somos, Sep 23 2024 *)
  • PARI
    a(n)=contfracpnqn(vector(n,i,1+(i>1)*(i%2)))[1,1]
    
  • PARI
    apply( {A002531(n,w=quadgen(12))=real((2+w)^(n\/2)*if(bittest(n, 0), w-1, 1))}, [0..30]) \\ M. F. Hasler, Nov 04 2019
    
  • PARI
    {a(n) = if(n<0, (-1)^n*a(-n), polcoeff( (1 + x - 2*x^2 + x^3) / (1 - 4*x^2 + x^4) + x*O(x^n), n))}; /* Michael Somos, Sep 23 2024 */
    
  • Sage
    s=((1+x-2*x^2+x^3)/(1-4*x^2+x^4)).series(x,40); s.coefficients(x, sparse=False) # G. C. Greubel, Nov 16 2018
    

Formula

G.f.: (1 + x - 2*x^2 + x^3)/(1 - 4*x^2 + x^4).
a(2*n) = a(2*n-1) + a(2*n-2), a(2*n+1) = 2*a(2*n) + a(2*n-1), n > 0.
a(2*n) = (1/2)*((2 + sqrt(3))^n+(2 - sqrt(3))^n); a(2*n) = A003500(n)/2; a(2*n+1) = round(1/(1 + sqrt(3))*(2 + sqrt(3))^n). - Benoit Cloitre, Dec 15 2002
a(n) = ((1 + sqrt(3))^n + (1 - sqrt(3))^n)/(2*2^floor(n/2)). - Bruno Berselli, Nov 10 2011
a(n) = A080040(n)/(2*2^floor(n/2)). - Ralf Stephan, Sep 08 2013
a(2*n) = (-1)^n*T(2*n,u) and a(2*n+1) = (-1)^n*1/u*T(2*n+1,u), where u = sqrt(-1/2) and T(n,x) denotes the Chebyshev polynomial of the first kind. - Peter Bala, May 01 2012
a(n) = (-sqrt(2)*i)^n*T(n, sqrt(2)*i/2)*2^(-floor(n/2)) = A026150(n)*2^(-floor(n/2)), n >= 0, with i = sqrt(-1) and the Chebyshev T polynomials (A053120). - Wolfdieter Lang, Feb 10 2018
From Franck Maminirina Ramaharo, Nov 14 2018: (Start)
a(n) = ((1 - sqrt(2))*(-1)^n + 1 + sqrt(2))*(((sqrt(2) - sqrt(6))/2)^n + ((sqrt(6) + sqrt(2))/2)^n)/4.
E.g.f.: cosh(sqrt(3/2)*x)*(sqrt(2)*sinh(x/sqrt(2)) + cosh(x/sqrt(2))). (End)
a(n) = (-1)^n*a(-n) for all n in Z. - Michael Somos, Mar 22 2022
a(n) = 4*a(n-2) - a(n-4). - Boštjan Gec, Sep 21 2023

Extensions

Name edited (as by discussion in A002530) by M. F. Hasler, Nov 04 2019

A041042 Numerators of continued fraction convergents to sqrt(27).

Original entry on oeis.org

5, 26, 265, 1351, 13775, 70226, 716035, 3650401, 37220045, 189750626, 1934726305, 9863382151, 100568547815, 512706121226, 5227629760075, 26650854921601, 271736178976085, 1385331749802026, 14125053676996345
Offset: 0

Views

Author

Keywords

Comments

Subset of |A002316| (conjectured).

Crossrefs

Programs

  • Mathematica
    Table[Numerator[FromContinuedFraction[ContinuedFraction[Sqrt[27],n]]],{n,1,50}] (* Vladimir Joseph Stephan Orlovsky, Mar 18 2011*)
    Numerator/@Convergents[Sqrt[27],20] (* Harvey P. Dale, Jul 21 2011 *)
    CoefficientList[Series[(- x^3 + 5 x^2 + 26 x + 5)/(x^4 - 52 x^2 + 1), {x, 0, 30}], x]  (* Vincenzo Librandi, Oct 28 2013 *)
    a0[n_] := (-5-3*Sqrt[3]+(-5+3*Sqrt[3])*(26+15*Sqrt[3])^(2*n))/(2*(26+15*Sqrt[3])^n) // Simplify
    a1[n_] := (1+(26+15*Sqrt[3])^(2*n))/(2*(26+15*Sqrt[3])^n) //  Simplify
    Flatten[MapIndexed[{a0[#], a1[#]}&,Range[10]]] (* Gerry Martens, Jul 10 2015 *)
    LinearRecurrence[{0,52,0,-1},{5,26,265,1351},30] (* Harvey P. Dale, Dec 12 2015 *)

Formula

G.f.: (-x^3+5x^2+26x+5)/(x^4-52x^2+1).
From Gerry Martens, Jul 11 2015: (Start)
Interspersion of 2 sequences [a0(n),a1(n)]:
a0(n) = ((-5-3*sqrt(3))/(26+15*sqrt(3))^n+(-5+3*sqrt(3))*(26+15*sqrt(3))^n)/2.
a1(n) = (1/(26+15*sqrt(3))^n+(26+15*sqrt(3))^n)/2. (End)

A131039 Expansion of (1-x)*(2*x^2-4*x+1)/(1-2*x+5*x^2-4*x^3+x^4).

Original entry on oeis.org

1, -3, -5, 7, 26, 0, -97, -97, 265, 627, -362, -2702, -1351, 8733, 13775, -18817, -70226, 0, 262087, 262087, -716035, -1694157, 978122, 7300802, 3650401, -23596563, -37220045, 50843527, 189750626, 0, -708158977, -708158977, 1934726305, 4577611587, -2642885282, -19726764302, -9863382151
Offset: 0

Views

Author

Creighton Dement, Jun 11 2007

Keywords

Comments

Unsigned bisection gives match to A002316 (Related to Bernoulli numbers). Note that all numbers in A002316 appear to be in A002531 (Numerators of continued fraction convergents to sqrt(3)) as well. a(12*n+5) = (0,0,0,0,...)
Floretion Algebra Multiplication Program, FAMP Code: 2tesseq['i + .5i' + .5j' + .5k' + .5e]

Crossrefs

Programs

  • Maple
    f:= gfun:-rectoproc({a(0)=1, a(1)=-3, a(2)=-5, a(3)=7, a(n)=2*a(n-1)-5*a(n-2)+4*a(n-3)-a(n-4)},a(n),remember):
    map(f, [$0..100]); # Robert Israel, Dec 25 2016
  • Mathematica
    CoefficientList[Series[(1-x)(2x^2-4x+1)/(1-2x+5x^2-4x^3+x^4),{x, 0, 50}], x] (* or *) LinearRecurrence[{2,-5,4,-1},{1,-3,-5,7},50] (* Harvey P. Dale, Aug 31 2011 *)

Formula

a(0)=1, a(1)=-3, a(2)=-5, a(3)=7, a(n)=2*a(n-1)-5*a(n-2)+4*a(n-3)-a(n-4) [Harvey P. Dale, Aug 31 2011]

A131040 a(n) = (1/2+1/2*i*sqrt(11))^n + (1/2-1/2*i*sqrt(11))^n, where i=sqrt(-1).

Original entry on oeis.org

1, -5, -8, 7, 31, 10, -83, -113, 136, 475, 67, -1358, -1559, 2515, 7192, -353, -21929, -20870, 44917, 107527, -27224, -349805, -268133, 781282, 1585681, -758165, -5515208, -3240713, 13304911, 23027050, -16887683, -85968833, -35305784
Offset: 0

Views

Author

Creighton Dement, Jun 11 2007

Keywords

Comments

Generating floretion is 1.5i' + .5j' + .5k' + .5e whereas in A131039 it is 'i + .5i' + .5j' + .5k' + .5e
Essentially the Lucas sequence V(1,3). - Peter Bala, Jun 23 2015

Crossrefs

Programs

  • Maple
    Floretion Algebra Multiplication Program, FAMP Code: 2tesseq[ 1.5i' + .5j' + .5k' + .5e]
  • Sage
    [lucas_number2(n,1,3) for n in range(1, 34)] # Zerinvary Lajos, May 14 2009

Formula

a(n) = a(n-1) - 3*a(n-2); G.f. (1 - 6*x)/(1 - x + 3*x^2).
a(n) = [x^n] ( (1 + x + sqrt(1 + 2*x - 11*x^2))/2 )^n. - Peter Bala, Jun 23 2015

A131041 a(n) = 2*a(n-1) - a(n-2) - a(n-4).

Original entry on oeis.org

1, 1, 1, -1, -4, -8, -13, -17, -17, -9, 12, 50, 105, 169, 221, 223, 120, -152, -645, -1361, -2197, -2881, -2920, -1598, 1921, 8321, 17641, 28559, 37556, 38232, 21267, -24257, -107337, -228649, -371228, -489550, -500535, -282871, 306021
Offset: 0

Views

Author

Creighton Dement, Jun 11 2007

Keywords

Comments

Generating floretion is .5i' + .5j' + .5k' + .5e + 'ii' (for A131039 it is 'i + .5i' + .5j' + .5k' + .5e and for A131040 it is 1.5i' + .5j' + .5k' + .5e)

Crossrefs

Programs

  • Maple
    Floretion Algebra Multiplication Program, FAMP Code: 2tesseq[.5i' + .5j' + .5k' + .5e + 'ii']
  • Mathematica
    LinearRecurrence[{2,-1,0,-1},{1,1,1,-1},40] (* Harvey P. Dale, Oct 14 2012 *)

Formula

G.f. (1-x-2*x^3)/(1-2*x+x^2+x^4)

A002317 Related to Genocchi numbers.

Original entry on oeis.org

2, 5, 7, -26, -265, -1351, -5042, -13775, -18817, 70226, 716035, 3650401, 13623482, 37220045, 50843527, -189750626, -1934726305, -9863382151, -36810643322, -100568547815, -137379191137, 512706121226, 5227629760075, 26650854921601
Offset: 0

Views

Author

Keywords

Comments

Denoted by beta'_n by Lehmer.

References

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

Crossrefs

a(n) = (-1)^n*A002316(-1-n).

Programs

  • Mathematica
    a[0] = 2; a[1] = 5; a[2] = 7; a[3] = -26; a[n_] := a[n] = -a[n-4] - 6*a[n-3] - 11*a[n-2] + 6*a[n-1]; Table[a[n], {n, 0, 23}] (* Jean-François Alcover, May 23 2013 *)
    CoefficientList[Series[(2 - 7 x - x^2 - x^3) / (1 - 6 x + 11 x^2 + 6 x^3 + x^4), {x, 0, 40}], x] (* Vincenzo Librandi, Jul 21 2013 *)
    LinearRecurrence[{6,-11,-6,-1},{2,5,7,-26},40] (* Harvey P. Dale, Jun 04 2017 *)
  • PARI
    {a(n)=if(n>=0, polcoeff( (2-7*x-x^2-x^3)/(1-6*x+11*x^2+6*x^3+x^4) +x*O(x^n),n), n=-1-n; (-1)^n*polcoeff( (1-x+7*x^2+2*x^3)/(1-6*x+11*x^2+6*x^3+x^4) +x*O(x^n),n) )} /* Michael Somos, Mar 27 2005 */

Formula

G.f.: (2-7*x-x^2-x^3)/(1-6*x+11*x^2+6*x^3+x^4).
a(n) = -2702*a(n-6) - a(n-12).
Showing 1-6 of 6 results.