%I #8 Jul 28 2015 15:22:20
%S 1,2,4,5,9,6,12,9,17,10,20,13,25,14,28,17,33,18,36,21,41,22,44,25,49,
%T 26,52,29,57,30,60,33,65,34,68,37,73,38,76,41,81,42,84,45,89,46,92,49,
%U 97,50,100,53,105,54,108,57,113,58,116,61,121,62,124,65,129,66,132,69,137
%N a(0)=1, a(n)=n+a(n-1) if n mod 2=0, a(n)=3n-a(n-1) if n mod 2 = 1.
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0, 1, 0, 1, 0, -1).
%F G.f.: (1+2x+3x^2+3x^3+4x^4-x^5)/((1+x^2)(1-x)^2(1+x)^2). a(n)=a(n-2)+a(n-4)-a(n-6). a(2n)=A047461(n+1). a(2n+1)=A042963(n+1). [From _R. J. Mathar_, Oct 29 2008]
%p a:=proc(n) if n=0 then 1 elif n mod 2=0 then n+a(n-1) else 3*n-a(n-1) fi end: seq(a(n),n=0..68);
%t a[0] = 1; a[n_] := a[n] = If[Mod[n, 2] == 0, a[n - 1] + n, -a[n - 1] + 3*n] aa = Table[a[n], {n, 0, 100}]
%K nonn
%O 0,2
%A _Roger L. Bagula_, Jun 18 2005