login
A048745
Partial sums of A048654.
3
1, 5, 14, 36, 89, 217, 526, 1272, 3073, 7421, 17918, 43260, 104441, 252145, 608734, 1469616, 3547969, 8565557, 20679086, 49923732, 120526553, 290976841, 702480238, 1695937320, 4094354881, 9884647085, 23863649054, 57611945196, 139087539449, 335787024097
OFFSET
0,2
FORMULA
a(n) = 2*a(n-1) + a(n-2) + 3, a(0)=1, a(1)=5.
a(n) = ( ((4+(5/2)*sqrt(2))*(1+sqrt(2))^n - (4-(5/2)*sqrt(2))*(1-sqrt(2))^n)/ 2*sqrt(2) ) - 3/2.
G.f.: (1+2*x)/((1-x)*(1-2*x-x^2)). - Paul D. Hanna, Feb 22 2005
a(n) = 3*a(n-1) - a(n-2) - a(n-3), n>2, a(0)=1, a(1)=5, a(2)=14. - Philippe Deléham, Dec 16 2008
2*a(n) = A135532(n+2) - 3. - R. J. Mathar, Mar 06 2013
a(n) = (1/2)*( 5*P(n+1) + 3*P(n) - 3), where P(n) = A000129(n). - G. C. Greubel, May 23 2021
MATHEMATICA
t={1, 5}; Do[AppendTo[t, t[[-2]] + 2*t[[-1]] + 3], {n, 40}]; t (* Vladimir Joseph Stephan Orlovsky, Jan 27 2012 *)
Accumulate[LinearRecurrence[{2, 1}, {1, 4}, 30]] (* or *) LinearRecurrence[{3, -1, -1}, {1, 5, 14}, 30] (* Harvey P. Dale, Aug 03 2020 *)
PROG
(PARI) a(n)=polcoeff((1+2*x)/(1-3*x+x^2+x^3)+x*O(x^n), n) \\ Paul D. Hanna
(Magma) I:=[1, 5, 14]; [n le 3 select I[n] else 3*Self(n-1) -Self(n-2) -Self(n-3): n in [1..31]]; // G. C. Greubel, May 23 2021
(Sage) [(5*lucas_number1(n+1, 2, -1) + 3*lucas_number1(n, 2, -1) -3)/2 for n in (0..30)] # G. C. Greubel, May 23 2021
CROSSREFS
KEYWORD
easy,nonn
STATUS
approved