OFFSET
0,1
COMMENTS
This is the Lucas sequence V_n(P, Q) = V_n(3, 4). U_n(P, Q) = U_n(3, 4) = A049072(n). ( a(n)/2 )^2 + 7*( A049072(n-1)/2 )^2 = 4^n. - Raphie Frank, Dec 04 2015
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,-4).
FORMULA
G.f.: (2 - 3*x) / (1 - 3*x + 4*x^2).
a(n) = a(-n) * 4^n for all n in Z.
a(n) = (-1)^n * A128415(n) if n > 0.
a(n) = ((3 + sqrt(-7))/2)^n + ((3 - sqrt(-7))/2)^n. - Raphie Frank, Dec 04 2015
EXAMPLE
G.f. = 2 + 3*x + x^2 - 9*x^3 - 31*x^4 - 57*x^5 - 47*x^6 + 87*x^7 + ...
MATHEMATICA
{a[0], a[1]} = {2, 3}; a[n_] := a[n] = 3 a[n - 1] - 4 a[n - 2]; Table[a@ n, {n, 0, 32}] (* Michael De Vlieger, Dec 04 2015 *)
CoefficientList[Series[(2-3*x)/(1-3*x+4*x^2), {x, 0, 60}], x] (* G. C. Greubel, Aug 04 2018 *)
PROG
(PARI) {a(n) = if( n<0, n=-n; 4^-n, 1) * polcoeff( (2 - 3*x) / (1 - 3*x + 4*x^2) + x * O(x^n), n)};
(Haskell)
a247563 n = a247563_list !! n
a247563_list = 2 : 3 : zipWith (-) (map (* 3) $ tail a247563_list)
(map (* 4) a247563_list)
-- Reinhard Zumkeller, Sep 20 2014
(Magma) [n le 2 select n+1 else 3*Self(n-1)-4*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Dec 05 2015
(Magma) m:=25; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((2 - 3*x)/(1-3*x+4*x^2))); // G. C. Greubel, Aug 04 2018
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Michael Somos, Sep 20 2014
STATUS
approved