login
a(n) = 4*a(n-1) - 7*a(n-2) + 6*a(n-3) - 3*a(n-4), starting with 0, 1, 2, 3.
2

%I #30 Jan 02 2024 08:56:42

%S 0,1,2,3,4,4,0,-13,-40,-81,-122,-122,0,365,1094,2187,3280,3280,0,

%T -9841,-29524,-59049,-88574,-88574,0,265721,797162,1594323,2391484,

%U 2391484,0,-7174453,-21523360,-43046721,-64570082,-64570082,0

%N a(n) = 4*a(n-1) - 7*a(n-2) + 6*a(n-3) - 3*a(n-4), starting with 0, 1, 2, 3.

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (4,-7,6,-3).

%F G.f.: x*(1-2*x+2*x^2)/((1-x+x^2)*(1-3*x+3*x^2)). - _Jaume Oliver Lafont_, Aug 30 2009

%F a(n) = A140343(n+3) - 2*A140343(n+2) + 2*A140343(n+1). - _R. J. Mathar_, Nov 21 2012

%F From _Peter Bala_, Jul 24 2017: (Start)

%F a(6*n) = 0;

%F a(6*n+1) = ((-1)^n*3^(3*n) + 1)/2;

%F a(6*n+2) = ((-1)^n*3^(3*n+1) + 1)/2;

%F a(6*n+3) = (-1)^n*3^(3*n+1);

%F a(6*n+4) = a(6*n+5) = ((-1)^n*3^(3*n+2) - 1)/2.

%F The o.g.f. A(x) satisfies (1 - x)*A(x) = x*A(1 - x).

%F Logarithmic g.f.: (1/sqrt(3))*arctan(sqrt(3)*x*(1 - x)/(1 - 2*x)) = Sum_{n >= 1} a(n)*x^n/n.

%F Sum_{n >= 1} a(n)/(n*2^n) = Pi/(2*sqrt(3)). (End)

%F a(n) = (3^(n/2) * sin(Pi*n/6) + sin(Pi*n/3)) / sqrt(3). - _Peter Luschny_, Jul 24 2017

%F 2*a(n) = A010892(n-1) + A057083(n-1). - _R. J. Mathar_, Oct 03 2021

%F a(n) = -26*a(n-6) + 27*a(n-12) for all n in Z. - _Michael Somos_, Jan 18 2023

%t LinearRecurrence[{4, -7, 6, -3}, {0, 1, 2, 3}, 50] (* _Harvey P. Dale_, Dec 06 2013 *)

%t a[ n_] := Nest[# + RotateRight @ #&, {0, -1, 0, 0, 0, 1}, n][[1]]; (* _Michael Somos_, Jan 18 2023 *)

%K sign,easy

%O 0,3

%A _Paul Curtz_, Jan 23 2008