Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #27 Feb 12 2024 09:31:11
%S 0,1,3,6,-2,7,13,20,-12,21,31,42,-30,43,57,72,-56,73,91,110,-90,111,
%T 133,156,-132,157,183,210,-182,211,241,272,-240,273,307,342,-306,343,
%U 381,420,-380,421,463,506,-462,507,553,600,-552,601,651,702,-650,703,757
%N a(0)=0; if a(n-1) is odd, a(n) = n + a(n-1), otherwise a(n) = n - a(n-1).
%H <a href="/index/Rec#order_12">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,3,0,0,0,-3,0,0,0,1).
%F G.f.: x*(1 +3*x +6*x^2 -2*x^3 +4*x^4 +4*x^5 +2*x^6 -6*x^7 +3*x^8 +x^9)/((1-x)^3*(1+x)^3*(1+x^2)^3). [_Bruno Berselli_, Jul 01 2013]
%F a(n) = 3*a(n-4) -3*a(n-8) +a(n-12). [_Bruno Berselli_, Jul 01 2013]
%F a(4n) = -A002939(n), a(4n+1) = A054569(n+1), a(4n+2) = A054554(n+2), a(4n+3) = A068377(n+2). [_Bruno Berselli_, Jul 02 2013]
%t LinearRecurrence[{0, 0, 0, 3, 0, 0, 0, -3, 0, 0, 0, 1}, {0, 1, 3, 6, -2, 7, 13, 20, -12, 21, 31, 42}, 60] (* _Bruno Berselli_, Jul 01 2013 *)
%o (Magma) [IsZero(n) select 0 else IsOdd(Self(n)) select n+Self(n) else n-Self(n): n in [0..60]]; // _Bruno Berselli_, Jul 01 2013
%o (Maxima) makelist(coeff(taylor(x*(1+3*x+6*x^2-2*x^3+4*x^4+4*x^5+2*x^6-6*x^7+3*x^8+x^9)/((1-x)^3*(1+x)^3*(1+x^2)^3), x, 0, n), x, n), n, 0, 60); /* _Bruno Berselli_, Jul 01 2013 */
%Y Cf. A081348 (second bisection); A002939, A054554, A054569, A068377.
%K sign,easy
%O 0,3
%A _Enrico Santilli_, Jun 23 2013
%E More terms from _Bruno Berselli_, Jul 01 2013