%I #12 Oct 08 2016 02:04:19
%S 0,1,5,19,60,182,546,1639,4919,14761,44286,132860,398580,1195741,
%T 3587225,10761679,32285040,96855122,290565366,871696099,2615088299,
%U 7845264901,23535794706,70607384120,211822152360,635466457081
%N Partial sums of A132357.
%H G. C. Greubel, <a href="/A135266/b135266.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (4,-3,-1,4,-3).
%F a(n+1) - 3a(n) = 0, 1, 2, 4, 3, 2,... (periodically extended with period length 6) = partial sums of A132367.
%F a(n) = (1/4)*3^(n+1) - (1/12)*(-1)^n + (1/3)*cos(Pi*n/3) - (sqrt(3)/3)*sin (Pi*n/3) - 1. Or, a(n) = (1/4)*3^(n+1) + (1/4)*[ -3; -5; -7; -5; -3; -1] for n>=0. - _Richard Choulet_, Jan 02 2008
%F O.g.f.: x*(1 +x +2*x^2)/((3*x-1)*(x+1)(x^2-x+1)*(x-1)). - _R. J. Mathar_, Jul 28 2008
%t Join[{0}, Table[(1/4)*3^(n + 1) - (1/12)*(-1)^n + (1/3)*Cos[Pi*n/3] - (Sqrt[3]/3)*Sin [Pi*n/3] - 1, {n, 1, 25}] (* _G. C. Greubel_, Oct 07 2016 *)
%o (PARI) a(n)=([0,1,0,0,0; 0,0,1,0,0; 0,0,0,1,0; 0,0,0,0,1; -3,4,-1,-3,4]^n*[0;1;5;19;60])[1,1] \\ _Charles R Greathouse IV_, Oct 08 2016
%K nonn,easy
%O 0,3
%A _Paul Curtz_, Dec 02 2007
%E Edited and extended by _R. J. Mathar_, Jul 28 2008