OFFSET
0,1
COMMENTS
In general, the ordinary generating function for the recurrence relation b(n) = r*b(n - 1) + s*b(n - 2), with n>1 and b(0)=k, b(1)=m, is (k - (k*r - m)*x)/(1 - r*x - s*x^2). This recurrence gives the closed form b(n) = (2^(-n - 1)*((k*r - 2*m)*(r - sqrt(r^2 + 4*s))^n + (2*m - k*r)*(sqrt(r^2 + 4*s) + r)^n + k*sqrt(r^2 + 4*s)*(r - sqrt(r^2 + 4*s))^n + k*sqrt(r^2 + 4*s)*(sqrt(r^2 + 4*s) + r)^n))/sqrt(r^2 + 4*s).
LINKS
FORMULA
G.f.: (3 - 7*x)/(1 - 4*x - 2*x^2).
a(n) = ((18 + sqrt(6))*(2 - sqrt(6))^n - (sqrt(6) - 18)*(2 + sqrt(6))^n)/12.
Lim_{n -> infinity} a(n + 1)/a(n) = 2 + sqrt(6) = A176213.
MATHEMATICA
RecurrenceTable[{a[0] == 3, a[1] == 5, a[n] == 4 a[n - 1] + 2 a[n - 2]}, a, {n, 23}]
LinearRecurrence[{4, 2}, {3, 5}, 24]
Table[((18 + Sqrt[6]) (2 - Sqrt[6])^n - (Sqrt[6] - 18) (2 + Sqrt[6])^n)/12, {n, 0, 23}]
PROG
(Magma) [n le 2 select 2*n+1 else 4*Self(n-1)+2*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Feb 04 2016
(PARI) Vec((3 - 7*x)/(1 - 4*x - 2*x^2) + O(x^30)) \\ Michel Marcus, Feb 04 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ilya Gutkovskiy, Feb 04 2016
STATUS
approved