OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,4,-4)
FORMULA
For n>2, a(n) = [3/2*2^n - (-2)^n - 2]/3. - Ralf Stephan, May 10 2004
From Colin Barker, Mar 16 2017: (Start)
G.f.: x*(1 + 3*x - 2*x^2 - 16*x^3 + 16*x^4) / ((1 - x)*(1 - 2*x)*(1 + 2*x)).
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3) for n>5.
(End)
EXAMPLE
n = 10: m = 6*170+4 = 1024 = 2^10, so a(10) = 170.
PROG
(PARI) Vec(x*(1 + 3*x - 2*x^2 - 16*x^3 + 16*x^4) / ((1 - x)*(1 - 2*x)*(1 + 2*x)) + O(x^40)) \\ Colin Barker, Mar 16 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Labos Elemer, Aug 28 2003
STATUS
approved