cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A226940 a(0)=0; if a(n-1) is odd, a(n) = n + a(n-1), otherwise a(n) = n - a(n-1).

This page as a plain text file.
%I A226940 #27 Feb 12 2024 09:31:11
%S A226940 0,1,3,6,-2,7,13,20,-12,21,31,42,-30,43,57,72,-56,73,91,110,-90,111,
%T A226940 133,156,-132,157,183,210,-182,211,241,272,-240,273,307,342,-306,343,
%U A226940 381,420,-380,421,463,506,-462,507,553,600,-552,601,651,702,-650,703,757
%N A226940 a(0)=0; if a(n-1) is odd, a(n) = n + a(n-1), otherwise a(n) = n - a(n-1).
%H A226940 <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 A226940 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 A226940 a(n) = 3*a(n-4) -3*a(n-8) +a(n-12). [_Bruno Berselli_, Jul 01 2013]
%F A226940 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 A226940 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 A226940 (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 A226940 (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 A226940 Cf. A081348 (second bisection); A002939, A054554, A054569, A068377.
%K A226940 sign,easy
%O A226940 0,3
%A A226940 _Enrico Santilli_, Jun 23 2013
%E A226940 More terms from _Bruno Berselli_, Jul 01 2013