OFFSET
0,1
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
T. D. Noe, Table of n, a(n) for n = 0..500
T. Crilly, Double sequences of positive integers, Math. Gaz., 69 (1985), 263-271.
R. K. Guy, Letter to N. J. A. Sloane, Feb 1986
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
Index entries for linear recurrences with constant coefficients, signature (0,3,0,-1).
FORMULA
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).
G.f.: (2+x-3*x^2-x^3)/((1-x-x^2)*(1+x-x^2))
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
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
From Peter Bala, Jan 11 2013: (Start)
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.
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)
a(n) = hypergeom([(1-n)/2, n mod 2 - n/2], [1 - n], -4) for n > 2. - Peter Luschny, Sep 03 2019
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
MAPLE
with(combinat): A005247 := n-> if n mod 2 = 1 then fibonacci(n) else fibonacci(n+1)+fibonacci(n-1); fi;
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.
MATHEMATICA
CoefficientList[Series[(2 + x - 3x^2 - x^3)/(1 - 3x^2 + x^4), {x, 0, 40}], x]
LinearRecurrence[{0, 3, 0, -1}, {2, 1, 3, 2}, 50] (* Harvey P. Dale, Oct 10 2012 *)
PROG
(PARI) a(n)=if(n%2, fibonacci(n), fibonacci(n+1)+fibonacci(n-1))
(Haskell)
a005247 n = a005247_list !! n
a005247_list = f a000032_list a000045_list where
f (x:_:xs) (_:y:ys) = x : y : f xs ys
-- Reinhard Zumkeller, Dec 27 2012
(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
CROSSREFS
KEYWORD
nonn,nice,easy
AUTHOR
EXTENSIONS
Additional comments from Michael Somos, May 01 2000
STATUS
approved