A005013 a(n) = 3*a(n-2) - a(n-4), a(0)=0, a(1)=1, a(2)=1, a(3)=4. Alternates Fibonacci (A000045) and Lucas (A000032) sequences for even and odd n.
0, 1, 1, 4, 3, 11, 8, 29, 21, 76, 55, 199, 144, 521, 377, 1364, 987, 3571, 2584, 9349, 6765, 24476, 17711, 64079, 46368, 167761, 121393, 439204, 317811, 1149851, 832040, 3010349, 2178309, 7881196, 5702887, 20633239, 14930352, 54018521, 39088169, 141422324
Offset: 0
Examples
G.f. = x + x^2 + 4*x^3 + 3*x^4 + 11*x^5 + 8*x^6 + 29*x^7 + 21*x^8 + 76*x^9 + ... a(3) = 4 since p(x) = (x^2 - 3*x + 4) / 2 interpolates p(1) = 1, p(2) = 1, p(3) = 2, and p(4) = 4. - _Michael Somos_, Jan 08 2012
References
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- G. C. Greubel, Table of n, a(n) for n = 0..2000 (terms 0..500 from T. D. Noe)
- A. F. Horadam, R. P. Loh and A. G. Shannon, Divisibility properties of some Fibonacci-type sequences, pp. 55-64 of Combinatorial Mathematics VI (Armidale 1978), Lect. Notes Math. 748, 1979. [Annotated scanned copy]
- Seong Ju Kim, R. Stees and L. Taalman, Sequences of Spiral Knot Determinants, Journal of Integer Sequences, Vol. 19 (2016), #16.1.4.
- D. H. Lehmer, An extended theory of Lucas' functions, Annals of Mathematics, Second Series, Vol. 31, No. 3 (Jul., 1930), pp. 419-448.
- 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.
- E. L. Roettger and H. C. Williams, Appearance of Primes in Fourth-Order Odd Divisibility Sequences, J. Int. Seq., Vol. 24 (2021), Article 21.7.5.
- E. W. Weisstein, MathWorld: Lehmer Number
- H. C. Williams and R. K. Guy, Odd and even linear divisibility sequences of order 4, INTEGERS, 2015, #A33.
- Index to divisibility sequences
- Index entries for linear recurrences with constant coefficients, signature (0,3,0,-1).
Crossrefs
Programs
-
GAP
a:=[0,1,1,4];; for n in [5..40] do a[n]:=3*a[n-2]-a[n-4]; od; a; # Muniru A Asiru, Oct 21 2018
-
Haskell
a005013 n = a005013_list !! n a005013_list = alt a000045_list a000032_list where alt (f::fs) (:l:ls) = f : l : alt fs ls -- Reinhard Zumkeller, Jan 10 2012
-
Magma
I:=[0,1,1,4]; [n le 4 select I[n] else 3*Self(n-2) - Self(n-4): n in [1..40]]; // Vincenzo Librandi, Feb 09 2016
-
Maple
with(combinat): A005013 := n-> if n mod 2 = 0 then fibonacci(n) else fibonacci(n+1)+fibonacci(n-1); fi; A005013:=z*(z**2+z+1)/((z**2+z-1)*(z**2-z-1)); # Simon Plouffe in his 1992 dissertation
-
Mathematica
CoefficientList[Series[(x + x^2 + x^3)/(1 - 3x^2 + x^4), {x, 0, 40}], x] f[n_] = Product[(1 + 4*Sin[k*Pi/n]^2), {k, 1, Floor[(n - 1)/2]}]; a = Table[f[n], {n, 0, 30}]; Round[a]; FullSimplify[ExpandAll[a]] (* Roger L. Bagula and Gary W. Adamson, Nov 26 2008 *) LinearRecurrence[{0, 3, 0, -1}, {0, 1, 1, 4}, 100] (* G. C. Greubel, Feb 08 2016 *)
-
PARI
{a(n) = if( n%2, fibonacci(n+1) + fibonacci(n-1), fibonacci(n))}; /* Michael Somos, Jan 08 2012 */
-
PARI
{a(n) = if( n<0, -a(-n), subst( polinterpolate( vector( n, k, fibonacci(k))), x, n+1))}; /* Michael Somos, Jan 08 2012 */
Formula
a(1) = a(2) = 1, a(3) = 4, a(n) = (a(n-1) * a(n-2) - 1) / a(n-3), unless n=3. a(-n) = -a(n).
a(2n) = A001906(n), a(2n+1) = A002878(n). a(n)=F(n+1)+(-1)^(n+1)F(n-1). - Mario Catalani (mario.catalani(AT)unito.it), Sep 20 2002
G.f.: x*(1+x+x^2)/((1-x-x^2)*(1+x-x^2)).
a(n) = Product_{k=1..floor((n-1)/2)} (1 + 4*sin(k*Pi/n)^2). - Roger L. Bagula and Gary W. Adamson, Nov 26 2008
Binomial transform is A096140. - Michael Somos, Apr 13 2012
From Peter Bala, Apr 18 2014: (Start)
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(5) + 1) and beta = (1/2)*(sqrt(5) - 1). Equivalently, a(n) = U(n-1, sqrt(5)/2) for n odd and a(n) = (1/sqrt(5))*U(n-1, sqrt(5)/2) for n even, where U(n,x) is the Chebyshev polynomial of the second kind. (End)
E.g.f.: (Phi/sqrt(5))*exp(-Phi*x)*(exp(x)-1)*(exp(sqrt(5)*x) - 1/(Phi)^2), where Phi = (1+sqrt(5))/2. - G. C. Greubel, Feb 08 2016
a(n) = (5^floor((n-1)/2)/2^(n-1))*Sum_{k=0..n-1} binomial(n-1,k)/5^floor(k/2). - Tony Foster III, Oct 21 2018
a(n) = hypergeom([(1 - n)/2, (n + 1) mod 2 - n/2], [1 - n], -4) for n >= 2. - Peter Luschny, Sep 03 2019
Extensions
Additional comments from Michael Somos, Jun 01 2000
Comments