login
a(n) = a(n-1) + 3*a(n-2).
(Formerly M1399)
15

%I M1399 #78 Dec 27 2023 11:52:43

%S 1,2,5,11,26,59,137,314,725,1667,3842,8843,20369,46898,108005,248699,

%T 572714,1318811,3036953,6993386,16104245,37084403,85397138,196650347,

%U 452841761,1042792802,2401318085,5529696491,12733650746,29322740219,67523692457,155491913114

%N a(n) = a(n-1) + 3*a(n-2).

%C The binomial transform of a(n) is b(n) = A006190(n+1), which satisfies b(n) = 3*b(n-1) + b(n-2). - _Paul Barry_, May 21 2006

%C Partial sums of A105476. - _Paul Barry_, Feb 02 2007

%C An elephant sequence, see A175654. For the corner squares four A[5] vectors, with decimal values 69, 261, 321 and 324, lead to this sequence. For the central square these vectors lead to the companion sequence A105476 (without the first leading 1). - _Johannes W. Meijer_, Aug 15 2010

%C Equals the INVERTi transform of A063782: (1, 3, 10, 32, 104, ...). - _Gary W. Adamson_, Aug 14 2010

%C Pisano period lengths: 1, 3, 1, 6, 24, 3, 24, 6, 3, 24, 120, 6, 156, 24, 24, 12, 16, 3, 90, 24, ... - _R. J. Mathar_, Aug 10 2012

%C The sequence is the INVERT transform of A016116: (1, 1, 2, 2, 4, 4, 8, 8, ...). - _Gary W. Adamson_, Jul 17 2015

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%H Vincenzo Librandi, <a href="/A006138/b006138.txt">Table of n, a(n) for n = 0..200</a>

%H N. T. Gridgeman, <a href="http://www.fq.math.ca/Scanned/11-1/gridgeman.pdf">A new look at Fibonacci generalization</a>, Fib,. Quart., 11 (1973), 40-55.

%H 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 Simon Plouffe, <a href="/A000051/a000051_2.pdf">1031 Generating Functions</a>, Appendix to Thesis, Montreal, 1992

%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (1,3).

%F a(n) = Sum_{k=0..n+1} A122950(n+1,k)*2^(n+1-k). - _Philippe Deléham_, Jan 04 2008

%F G.f.: (1+x)/(1-x-3*x^2). - _Paul Barry_, May 21 2006

%F a(n) = Sum_{k=0..n} C(floor((2n-k)/2),n-k)*3^floor(k/2). - _Paul Barry_, Feb 02 2007

%F a(n) = A006130(n) + A006130(n-1). - _R. J. Mathar_, Jun 22 2011

%F 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

%p A006138:=-(1+z)/(-1+z+3*z**2); # _Simon Plouffe_ in his 1992 dissertation

%t CoefficientList[Series[(1+z)/(1-z-3*z^2), {z,0,40}], z] (* _Vladimir Joseph Stephan Orlovsky_, Jun 11 2011 *)

%t 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 *)

%o (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 */

%o (Magma) [n le 2 select n else Self(n-1)+3*Self(n-2): n in [1..40]]; // _Vincenzo Librandi_, Sep 15 2016

%o (Sage)

%o def A006138_list(prec):

%o P.<x> = PowerSeriesRing(ZZ, prec)

%o return P((1+x)/(1-x-3*x^2)).list()

%o A006138_list(40) # _G. C. Greubel_, Nov 19 2019

%o (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

%Y Cf. A063782. - _Gary W. Adamson_, Aug 14 2010

%Y Cf. A006130, A006190, A016116, A105476, A122950, A175654, A274977.

%K nonn,easy

%O 0,2

%A _N. J. A. Sloane_

%E Typo in formula corrected by _Johannes W. Meijer_, Aug 15 2010