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.

A309214 a(0)=0; thereafter a(n) = a(n-1)+n if a(n-1) even, otherwise a(n) = a(n-1)-n.

This page as a plain text file.
%I A309214 #20 Aug 13 2019 13:17:19
%S A309214 0,1,-1,-4,0,5,-1,-8,0,9,-1,-12,0,13,-1,-16,0,17,-1,-20,0,21,-1,-24,0,
%T A309214 25,-1,-28,0,29,-1,-32,0,33,-1,-36,0,37,-1,-40,0,41,-1,-44,0,45,-1,
%U A309214 -48,0,49,-1,-52,0,53,-1,-56,0,57,-1,-60,0,61,-1,-64,0,65,-1,-68,0,69,-1,-72,0,73,-1
%N A309214 a(0)=0; thereafter a(n) = a(n-1)+n if a(n-1) even, otherwise a(n) = a(n-1)-n.
%C A309214 A003816 and A309215 have the same terms except for signs.
%H A309214 Colin Barker, <a href="/A309214/b309214.txt">Table of n, a(n) for n = 0..1000</a>
%H A309214 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,-2,2,-1,1).
%F A309214 a(4t)=0, a(4t+1)=4t+1, a(4t+2)=-1, a(4t+3)=-(4t+4).
%F A309214 From _Colin Barker_, Aug 13 2019: (Start)
%F A309214 G.f.: x*(1 - 2*x - x^2) / ((1 - x)*(1 + x^2)^2).
%F A309214 a(n) = a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) + a(n-5) for n>4.
%F A309214 a(n) = (-2 + (1+i)*(-i)^n + (1-i)*i^n + 2*i*((-i)^n-i^n)*n) / 4 where i=sqrt(-1).
%F A309214 (End)
%F A309214 E.g.f.: (1/2)*((1+2*x)*cos(x)-cosh(x)+sin(x)-sinh(x)). - _Stefano Spezia_, Aug 13 2019 after _Colin Barker_
%p A309214 t:=0;
%p A309214 a:=[t]; M:=100;
%p A309214 for i from 1 to M do
%p A309214 if (t mod 2) = 0 then t:=t+i else t:=t-i; fi;
%p A309214 a:=[op(a),t]; od:
%p A309214 a;
%o A309214 (PARI) concat(0, Vec(x*(1 - 2*x - x^2) / ((1 - x)*(1 + x^2)^2) + O(x^80))) \\ _Colin Barker_, Aug 13 2019
%Y A309214 Cf. A003816, A309529, A309215, A309216, A319217.
%K A309214 sign,easy
%O A309214 0,4
%A A309214 _N. J. A. Sloane_, Aug 10 2019