OFFSET
1,2
COMMENTS
Let A be the Hessenberg matrix of order n, defined by: A[1,j] = 1, A[i,i] := 11, (i>1), A[i,i-1] = -1, and A[i,j] = 0 otherwise. Then, for n>=1, a(2n-1)=(-1)^(n-1)*charpoly(A,2). - Milan Janjic, Feb 21 2010
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3, 1, -3).
FORMULA
From R. J. Mathar, Mar 13 2010: (Start)
a(n) = (7*3^(n - 1) + 2 + (-1)^n)/8.
a(n) = 3*a(n-1) + a(n-2) - 3*a(n-3).
G.f.: x*(-1 + 2*x^2)/ ((1-x) * (3*x-1) * (1+x)). (End)
E.g.f.: (1/24)*(3*exp(-x) - 16 + 6*exp(x) + 7*exp(3*x)). - G. C. Greubel, Aug 27 2016
EXAMPLE
a(2) = 3*1 = 3.
a(3) = 3*a(2)-1 = 8.
a(4) = 3*a(3) = 24.
MAPLE
A153774 := proc(n) 1/4+(-1)^n/8+7*3^(n-1)/8 ; end proc: seq(A153774(n), n=1..80) ; # R. J. Mathar, Mar 13 2010
MATHEMATICA
LinearRecurrence[{3, 1, -3}, {1, 3, 8}, 30] (* or *) Rest[ CoefficientList[ Series[x (-1+2x^2)/((1-x)(3x-1)(1+x)), {x, 0, 30}], x]] (* Harvey P. Dale, Jun 08 2011 *)
RecurrenceTable[{a[1] == 1, a[2] == 3, a[3] == 8, a[n] == 3 a[n-1] + a[n-2] - 3 a[n-3]}, a, {n, 30}] (* Vincenzo Librandi, Aug 28 2016 *)
PROG
(Magma) I:=[1, 3, 8]; [n le 3 select I[n] else 3*Self(n-1) + Self(n-2) - 3*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Aug 28 2016
(PARI) a(n)=(3^(n-1)*7)\/8 \\ Charles R Greathouse IV, Aug 28 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jan 01 2009
STATUS
approved