%I #30 Apr 03 2019 11:10:59
%S 1,1,1,3,6,12,24,46,87,163,303,561,1036,1910,3518,6476,11917,21925,
%T 40333,74191,136466,251008,461684,849178,1561891,2872775,5283867,
%U 9718557,17875224,32877674,60471482,111224408,204573593,376269513,692067545
%N a(n) = 3*a(n-1) - 2*a(n-2) - a(n-4) + a(n-5) with initial terms 1, 1, 1, 3, 6.
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2,0,-1,1).
%F a(1)=1, a(2)=1, a(3)=1; a(n) = a(n-1) + a(n-2) + a(n-3) + n - 4 for n >= 4.
%F G.f.: x*(-1+2*x-2*x^3) / ((x-1)^2*(x^3+x^2+x-1)).
%e a(7) = (a(6): 12) + (a(5): 6) + (a(4): 3) + (n-4: 3) = 24.
%t LinearRecurrence[{3, -2, 0, -1, 1}, {1, 1, 1, 3, 6}, 42] (* _T. D. Noe_, Oct 06 2011 *)
%o (PARI) x='x+O('x^43); Vec(x*(-1+2*x-2*x^3) / ((x-1)^2*(x^3+x^2+x-1))) \\ _Georg Fischer_, Apr 03 2019
%K nonn,easy
%O 1,4
%A _Aditya Subramanian_, Oct 06 2011
%E Better name from _Charles R Greathouse IV_, Oct 06 2011
%E Edited and corrected by _Georg Fischer_, Apr 03 2019
|