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

%I #26 Feb 28 2019 04:47:56

%S 0,0,1,2,3,6,10,20,33,66,109,218,360,720,1189,2378,3927,7854,12970,

%T 25940,42837,85674,141481,282962,467280,934560,1543321,3086642,

%U 5097243,10194486,16835050,33670100,55602393,111204786,183642229,367284458,606529080

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

%C Difference table:

%C 0, 0, 1, 2, 3, 6, 10, 20, 33, 66, ... = a(n)

%C 0, 1, 1, 1, 3, 4, 10, 13, 33, 43, ... = b(n)

%C 1, 0, 0, 2, 1, 6, 3, 20, 10, 66, ... = c(n).

%C c(2n+1)=a(2n+1), c(2n+2)=a(2n).

%H Colin Barker, <a href="/A305889/b305889.txt">Table of n, a(n) for n = 0..1000</a>

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

%F a(2n) = A006190(n), a(2n+1) = 2*a(2n).

%F G.f.: x^2*(1 + 2*x) / (1 - 3*x^2 - x^4). - _Colin Barker_, Jun 14 2018

%t Nest[Append[#, 3 #[[-2]] + #[[-4]]] &, {0, 0, 1, 2}, 33] (* or *)

%t CoefficientList[Series[x^2*(1 + 2 x)/(1 - 3 x^2 - x^4), {x, 0, 36}], x] (* _Michael De Vlieger_, Jun 14 2018 *)

%t LinearRecurrence[{0, 3, 0, 1}, {0, 0, 1, 2}, 41] (* _Robert G. Wilson v_, Jul 10 2018 *)

%o (PARI) concat(vector(2), Vec(x^2*(1 + 2*x) / (1 - 3*x^2 - x^4) + O(x^40))) \\ _Colin Barker_, Jun 14 2018

%Y Cf. A006190 (bisection of a(n),b(n) and, from the second 0,c(n)).

%Y Cf. A003688(n+1) (from the third 1, bisection of b(n)).

%K nonn,easy

%O 0,4

%A _Paul Curtz_, Jun 14 2018