A006138 a(n) = a(n-1) + 3*a(n-2).
1, 2, 5, 11, 26, 59, 137, 314, 725, 1667, 3842, 8843, 20369, 46898, 108005, 248699, 572714, 1318811, 3036953, 6993386, 16104245, 37084403, 85397138, 196650347, 452841761, 1042792802, 2401318085, 5529696491, 12733650746, 29322740219, 67523692457, 155491913114
Offset: 0
References
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..200
- N. T. Gridgeman, A new look at Fibonacci generalization, Fib,. Quart., 11 (1973), 40-55.
- 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 (1,3).
Crossrefs
Programs
-
GAP
a:=[1,2];; for n in [3..40] do a[n]:=a[n-1]+3*a[n-2]; od; a; # G. C. Greubel, Nov 19 2019
-
Magma
[n le 2 select n else Self(n-1)+3*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Sep 15 2016
-
Maple
A006138:=-(1+z)/(-1+z+3*z**2); # Simon Plouffe in his 1992 dissertation
-
Mathematica
CoefficientList[Series[(1+z)/(1-z-3*z^2), {z,0,40}], z] (* Vladimir Joseph Stephan Orlovsky, Jun 11 2011 *) Table[(I*Sqrt[3])^(n-1)*(I*Sqrt[3]*ChebyshevU[n, 1/(2*I*Sqrt[3])] + ChebyshevU[n-1, 1/(2*I*Sqrt[3])]), {n, 0, 40}]//Simplify (* G. C. Greubel, Nov 19 2019 *) LinearRecurrence[{1,3},{1,2},40] (* Harvey P. Dale, May 29 2025 *)
-
PARI
main(size)={my(v=vector(size),i);v[1]=1;v[2]=2;for(i=3,size,v[i]=v[i-1]+3*v[i-2]);return(v);} /* Anders Hellström, Jul 17 2015 */
-
Sage
def A006138_list(prec): P.
= PowerSeriesRing(ZZ, prec) return P((1+x)/(1-x-3*x^2)).list() A006138_list(40) # G. C. Greubel, Nov 19 2019
Formula
a(n) = Sum_{k=0..n+1} A122950(n+1,k)*2^(n+1-k). - Philippe Deléham, Jan 04 2008
G.f.: (1+x)/(1-x-3*x^2). - Paul Barry, May 21 2006
a(n) = Sum_{k=0..n} C(floor((2n-k)/2),n-k)*3^floor(k/2). - Paul Barry, Feb 02 2007
a(n) = (i*sqrt(3))^(n-1)*(i*sqrt(3)*ChebyshevU(n, 1/(2*i*sqrt(3))) + ChebyshevU(n-1, 1/(2*i*sqrt(3)))), where i=sqrt(-1). - G. C. Greubel, Nov 19 2019
Extensions
Typo in formula corrected by Johannes W. Meijer, Aug 15 2010
Comments