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.
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
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.
Links
- Harry J. Smith, Table of n, a(n) for n = 0..2000
- MacTutor, D'Arcy Thompson on Greek irrationals
- Simon Plouffe, Approximations de séries génératrices et quelques conjectures, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
- Simon Plouffe, 1031 Generating Functions, Appendix to Thesis, Montreal, 1992
- Albert Tarn, Approximations to certain square roots and the series of numbers connected therewith [Annotated scanned copy]
- D'Arcy Thompson, Excess and Defect: Or the Little More and the Little Less, Mind, New Series, Vol. 38, No. 149 (Jan., 1929), pp. 43-55 (13 pages). See page 48.
- Hein van Winkel, Q-quadrangles inscribed in a circle, 2014. See Table 1. [Reference from Antreas Hatzipolakis, Jul 14 2014]
- Index entries for "core" sequences
- Index entries for linear recurrences with constant coefficients, signature (0,4,0,-1).
- Index entries for sequences related to Chebyshev polynomials.
Crossrefs
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
Comments