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.

A003816 a(0) = 0, a(n) = a(n-1) XOR -n.

This page as a plain text file.
%I A003816 #21 Sep 08 2022 08:44:32
%S A003816 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,25,-1,
%T A003816 28,0,29,-1,32,0,33,-1,36,0,37,-1,40,0,41,-1,44,0,45,-1,48,0,49,-1,52,
%U A003816 0,53,-1,56,0,57,-1,60,0,61,-1,64,0,65,-1,68
%N A003816 a(0) = 0, a(n) = a(n-1) XOR -n.
%H A003816 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,1,0,1,0,-1).
%F A003816 G.f.: x*(1-x+3x^2+x^3)/((x^2-1)^2*(x^2+1)).
%F A003816 |a(n)| = n-(-1)^n*|a(n-1)|. - _Vladeta Jovovic_, Mar 13 2003
%F A003816 a(4n)=0, a(4n+1)=4n+1, a(4n+2)=-1, a(4n+3)=4n+4, n>=0.
%F A003816 From _Wesley Ivan Hurt_, May 01 2016, May 03 2016: (Start)
%F A003816 a(n) = a(n-2)+a(n-4)-a(n-6) for n>5.
%F A003816 a(n) = (-1)^floor((n-1)/2) * Sum_{i=0..n} i*(-1)^floor(i/2).
%F A003816 a(n) = (n-(n+1)*(-1)^n+(-1)^((2*n+1-(-1)^n)/4))/2. (End)
%F A003816 E.g.f.: (cos(x) + (-1 + 2*x)*cosh(x) - sin(x) + sinh(x))/2. - _Ilya Gutkovskiy_, May 03 2016
%p A003816 A003816:=n->(n-(n+1)*(-1)^n+(-1)^((2*n+1-(-1)^n)/4))/2: seq(A003816(n), n=0..150); # _Wesley Ivan Hurt_, May 03 2016
%t A003816 CoefficientList[Series[x*(1 - x + 3 x^2 + x^3)/((x^2 - 1)^2*(x^2 + 1)), {x, 0, 100}], x] (* _Wesley Ivan Hurt_, May 01 2016 *)
%t A003816 nxt[{n_,a_}]:={n+1,BitXor[a,-n-1]}; -#&/@(NestList[nxt,{0,0},70][[All,2]]) (* or *) LinearRecurrence[{0,1,0,1,0,-1},{0,1,-1,4,0,5},70] (* _Harvey P. Dale_, Oct 16 2019 *)
%o A003816 (PARI) a(n)=([0,1,0,0,0,0; 0,0,1,0,0,0; 0,0,0,1,0,0; 0,0,0,0,1,0; 0,0,0,0,0,1; -1,0,1,0,1,0]^n*[0;1;-1;4;0;5])[1,1] \\ _Charles R Greathouse IV_, May 02 2016
%o A003816 (Magma) [(n-(n+1)*(-1)^n+(-1)^((2*n+1-(-1)^n) div 4))/2 : n in [0..100]]; // _Wesley Ivan Hurt_, May 03 2016
%Y A003816 Cf. A003815.
%K A003816 sign,easy
%O A003816 0,4
%A A003816 _Marc LeBrun_