OFFSET
0,1
COMMENTS
Ratio of successive terms approaches 2.
LINKS
Iain Fox, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,1,-2)
FORMULA
EXAMPLE
a(0) = 2.
a(1) = 2.
a(2) = 2 + 2*2 + 3 = 9.
a(3) = 9 + 2*2 + 3 = 16.
a(4) = 16 + 9*2 + 3 = 37.
...
MATHEMATICA
Table[(2^(n + 2) + 2 (-1)^n) / 3 + 2^n - (3 - (-1)^n) / 2, {n, 0, 40}] (* Vincenzo Librandi, Oct 20 2017 *)
PROG
(PARI) Vec((2/(1-x-2*x^2)) + (3*x^2/((1-x)*(1-x-2*x^2))) + O(x^50)) \\ Michel Marcus, Oct 12 2017
(PARI) first(n) = Vec((2 - 2*x + 3*x^2)/(1 - 2*x - x^2 + 2*x^3) + O(x^n)) \\ Iain Fox, Dec 18 2017
(Magma) [(2^(n+2)+2*(-1)^n)/3+2^n-(3-(-1)^n)/2: n in [0..40]]; // Vincenzo Librandi, Oct 20 2017
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Iain Fox, Oct 11 2017
STATUS
approved