login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A182415
a(0) = 1, a(1) = 2; for n>1, a(n) = a(n-1) + a(n-2) + 4.
1
1, 2, 7, 13, 24, 41, 69, 114, 187, 305, 496, 805, 1305, 2114, 3423, 5541, 8968, 14513, 23485, 38002, 61491, 99497, 160992, 260493, 421489, 681986, 1103479, 1785469, 2888952, 4674425, 7563381, 12237810, 19801195, 32039009, 51840208, 83879221, 135719433, 219598658
OFFSET
0,2
FORMULA
From Colin Barker, May 07 2012: (Start)
a(n) = 2*a(n-1) - a(n-3).
G.f.: (1+3*x^2)/((1-x)*(1-x-x^2)). (End)
a(n) = Fibonacci(n+3) + 3*Fibonacci(n+1) - 4. - G. C. Greubel, Jul 22 2019
EXAMPLE
a(3) = 7 + 2 + 4 = 13.
MATHEMATICA
With[{f=Fibonacci}, Table[F[n+3]+3*F[n+1]-4, {n, 0, 40}]] (* G. C. Greubel, Jul 22 2019 *)
RecurrenceTable[{a[0]==1, a[1]==2, a[n]==a[n-1]+a[n-2]+4}, a, {n, 40}] (* or *) LinearRecurrence[{2, 0, -1}, {1, 2, 7}, 40] (* Harvey P. Dale, Nov 24 2020 *)
PROG
(PARI) vector(40, n, n--; f=fibonacci; f(n+3) +3*f(n+1) -4 ) \\ G. C. Greubel, Jul 22 2019
(Magma) F:=Fibonacci; [F(n+3)+3*F(n+1)-4: n in [0..40]]; // G. C. Greubel, Jul 22 2019
(Sage) f=fibonacci; [f(n+3)+3*f(n+1)-4 for n in (0..40)] # G. C. Greubel, Jul 22 2019
(GAP) F:=Fibonacci;; List([0..40], n-> F(n+3)+3*F(n+1)-4); # G. C. Greubel, Jul 22 2019
CROSSREFS
Cf. A000045, A014739, A022095 (first differences), A171516.
Sequence in context: A045377 A180470 A237443 * A275491 A360673 A183435
KEYWORD
nonn,easy
AUTHOR
Alex Ratushnyak, Apr 28 2012
STATUS
approved