OFFSET
1,1
COMMENTS
See A192232.
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (2,2,2,-1).
FORMULA
a(n) = 2*A192237(n+2).
G.f.: 2*x/(1-2*x-2*x^2-2*x^3+x^4). - Colin Barker, Sep 12 2012
MATHEMATICA
q[x_]:= x + 1; m:=40;
reductionRules = {x^y_?EvenQ -> q[x]^(y/2), x^y_?OddQ -> x q[x]^((y - 1)/2)};
t = Table[Last[Most[FixedPointList[Expand[#1 /. reductionRules] &, ChebyshevU[n, x]]]], {n, m}];
Table[Coefficient[Part[t, n], x, 0], {n, m}] (* A192235 *)
Table[Coefficient[Part[t, n], x, 1], {n, m}] (* A192236 *)
Table[Coefficient[Part[t, n]/2, x, 1], {n, m}] (* A192237 *)
(* Peter J. C. Moses, Jun 25 2011 *)
LinearRecurrence[{2, 2, 2, -1}, {2, 4, 12, 36}, 40] (* G. C. Greubel, Jul 30 2019 *)
PROG
(PARI) m=40; v=concat([2, 4, 12, 36], vector(m-4)); for(n=5, m, v[n] = 2*v[n-1]+2*v[n-2]+2*v[n-3]-v[n-4]); v \\ G. C. Greubel, Jul 30 2019
(Magma) I:=[2, 4, 12, 36]; [n le 4 select I[n] else 2*Self(n-1) +2*Self(n-2) +2*Self(n-3) -Self(n-4): n in [1..40]]; // G. C. Greubel, Jul 30 2019
(Sage)
def a(n):
if (n==0): return 2
elif (1 <= n <= 3): return 4*3^(n-1)
else: return 2*(a(n-1) + a(n-2) + a(n-3)) - a(n-4)
[a(n) for n in (0..40)] # G. C. Greubel, Jul 30 2019
(GAP) a:=[2, 4, 12, 36];; for n in [5..40] do a[n]:=2*a[n-1]+2*a[n-2]+ 2*a[n-3]-a[n-4]; od; a; # G. C. Greubel, Jul 30 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Jun 26 2011
STATUS
approved