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.

A005247 a(n) = 3*a(n-2) - a(n-4), a(0)=2, a(1)=1, a(2)=3, a(3)=2. Alternates Lucas (A000032) and Fibonacci (A000045) sequences for even and odd n.

This page as a plain text file.
%I A005247 M0149 #64 Mar 16 2022 02:58:06
%S A005247 2,1,3,2,7,5,18,13,47,34,123,89,322,233,843,610,2207,1597,5778,4181,
%T A005247 15127,10946,39603,28657,103682,75025,271443,196418,710647,514229,
%U A005247 1860498,1346269,4870847,3524578,12752043,9227465,33385282,24157817
%N A005247 a(n) = 3*a(n-2) - a(n-4), a(0)=2, a(1)=1, a(2)=3, a(3)=2. Alternates Lucas (A000032) and Fibonacci (A000045) sequences for even and odd n.
%D A005247 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A005247 T. D. Noe, <a href="/A005247/b005247.txt">Table of n, a(n) for n = 0..500</a>
%H A005247 T. Crilly, <a href="http://www.jstor.org/stable/3617570">Double sequences of positive integers</a>, Math. Gaz., 69 (1985), 263-271.
%H A005247 R. K. Guy, <a href="/A005246/a005246.pdf">Letter to N. J. A. Sloane, Feb 1986</a>
%H A005247 Simon Plouffe, <a href="https://arxiv.org/abs/0911.4975">Approximations de séries génératrices et quelques conjectures</a>, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
%H A005247 Simon Plouffe, <a href="/A000051/a000051_2.pdf">1031 Generating Functions</a>, Appendix to Thesis, Montreal, 1992
%H A005247 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,3,0,-1).
%F A005247 a(0)=2, a(1)=1, a(2)=3, a(n) = (1+a(n-1)a(n-2))/a(n-3), n >= 3. a(-n) = a(n).
%F A005247 G.f.: (2+x-3*x^2-x^3)/((1-x-x^2)*(1+x-x^2))
%F A005247 a(n) = F(n) if n odd, a(n) = L(n) if n even. a(n) = F(n+1)+(-1)^nF(n-1). - Mario Catalani (mario.catalani(AT)unito.it), Sep 20 2002
%F A005247 a(n) = ((5+sqrt(5))/10)*(((1+sqrt(5))/2)^n+((-1+sqrt(5))/2)^n)+((5-sqrt(5))/10)*(((1-sqrt(5))/2)^n+((-1-sqrt(5))/2)^n). With additional leading 1: a(n)=((sqrt(5))/5)*(((1+sqrt(5))/2)^n-((1-sqrt(5))/2)^n)+((5+3*sqrt(5))/10)*((-1+sqrt(5))/2)^n+((5-3*sqrt(5))/10)*((-1-sqrt(5))/2)^n. - _Tim Monahan_, Jul 25 2011
%F A005247 From _Peter Bala_, Jan 11 2013: (Start)
%F A005247 Let phi = 1/2*(sqrt(5) - 1). This sequence is the simple continued fraction expansion of the real number 1 + product {n >= 0} (1 + sqrt(5)*phi^(4*n+1))/(1 + sqrt(5)*phi^(4*n+3)) = 2.77616 23282 02325 23857 ... = 2 + 1/(1 + 1/(3 + 1/(2 + 1/(7 + ...)))). Cf. A005248.
%F A005247 Furthermore, for k = 0,1,2,... the simple continued fraction expansion of 1 + product {n >= 0} (1 + 1/5^k*sqrt(5)*phi^(4*n+1))/(1 + 1/5^k*sqrt(5)*phi^(4*n+3)) equals [2; 1*5^k, 3, 2*5^k, 7, 5*5^k, 18, 13*5^k, 47, ...]. (End)
%F A005247 a(n) = hypergeom([(1-n)/2, n mod 2 - n/2], [1 - n], -4) for n > 2. - _Peter Luschny_, Sep 03 2019
%F A005247 E.g.f.: 2*cosh(x/2)*(5*cosh(sqrt(5)*x/2) + sqrt(5)*sinh(sqrt(5)*x/2))/5. - _Stefano Spezia_, Mar 15 2022
%p A005247 with(combinat): A005247 := n-> if n mod 2 = 1 then fibonacci(n) else fibonacci(n+1)+fibonacci(n-1); fi;
%p A005247 A005247:=-(z+1)*(3*z**2-z-1)/(z**2-z-1)/(z**2+z-1); # _Simon Plouffe_ in his 1992 dissertation. Gives sequence with an additional leading 1.
%t A005247 CoefficientList[Series[(2 + x - 3x^2 - x^3)/(1 - 3x^2 + x^4), {x, 0, 40}], x]
%t A005247 LinearRecurrence[{0,3,0,-1},{2,1,3,2},50] (* _Harvey P. Dale_, Oct 10 2012 *)
%o A005247 (PARI) a(n)=if(n%2,fibonacci(n),fibonacci(n+1)+fibonacci(n-1))
%o A005247 (Haskell)
%o A005247 a005247 n = a005247_list !! n
%o A005247 a005247_list = f a000032_list a000045_list where
%o A005247    f (x:_:xs) (_:y:ys) = x : y : f xs ys
%o A005247 -- _Reinhard Zumkeller_, Dec 27 2012
%o A005247 (Magma) I:=[2,1,3,2]; [n le 4 select I[n] else 3*Self(n-2) - Self(n-2): n in [1..30]]; // _G. C. Greubel_, Dec 21 2017
%Y A005247 Cf. A000032, A000045, A005013, A005013, A005246, A005248.
%K A005247 nonn,nice,easy
%O A005247 0,1
%A A005247 _N. J. A. Sloane_
%E A005247 Additional comments from _Michael Somos_, May 01 2000