login
Numbers that are congruent to {0, 1, 2, 3} mod 8.
5

%I #48 Sep 08 2022 08:44:57

%S 0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27,32,33,34,35,40,41,42,43,48,

%T 49,50,51,56,57,58,59,64,65,66,67,72,73,74,75,80,81,82,83,88,89,90,91,

%U 96,97,98,99,104,105,106,107,112,113,114,115,120,121,122

%N Numbers that are congruent to {0, 1, 2, 3} mod 8.

%C Primes of this sequence are in A033203. All of these numbers satisfy the condition that n XOR 4 = n + 4. - _Brad Clardy_, Jul 24 2012

%C Numbers k such that floor(k/4) = 2*floor(k/8). - _Bruno Berselli_, Oct 05 2017

%H Vincenzo Librandi, <a href="/A047476/b047476.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,1,-1).

%F a(n) = 8 * floor(n/4) + (n mod 4), with offset 0.. a(0)=0. - _Gary Detlefs_, Mar 09 2010

%F From _Colin Barker_, May 14 2012: (Start)

%F a(n) = (-7 - (-1)^n - (1-i)*(-i)^n - (1+i)*i^n + 4*n)/2, where i=sqrt(-1).

%F G.f.: x^2*(1 + x + x^2 + 5*x^3)/((1 - x)^2*(1 + x)*(1 + x^2)). (End)

%F a(n) = a(n-1) + a(n-4) - a(n-5). - _Vincenzo Librandi_, May 16 2012

%F a(2*k) = A047471, a(2*k-1) = A047467(k). - _Wesley Ivan Hurt_, Jun 01 2016

%F E.g.f.: 5 + sin(x) - cos(x) + (2*x - 3)*sinh(x) + 2*(x - 2)*cosh(x). - _Ilya Gutkovskiy_, Jun 01 2016

%F Sum_{n>=2} (-1)^n/a(n) = (2*sqrt(2)-1)*Pi/16 + 5*log(2)/8. - _Amiram Eldar_, Dec 19 2021

%p A047476:=n->(-7-(-1)^n-(1-I)*(-I)^n-(1+I)*I^n+4*n)/2: seq(A047476(n), n=1..100); # _Wesley Ivan Hurt_, Jun 01 2016

%t Select[Range[0,300], MemberQ[{0,1,2,3}, Mod[#,8]]&] (* _Vincenzo Librandi_, May 16 2012 *)

%t LinearRecurrence[{1,0,0,1,-1},{0,1,2,3,8},100] (* _G. C. Greubel_, Jun 01 2016 *)

%o (Magma) I:=[0, 1, 2, 3, 8]; [n le 5 select I[n] else Self(n-1)+Self(n-4)-Self(n-5): n in [1..70]]; // _Vincenzo Librandi_, May 16 2012

%o (Haskell)

%o a047476 n = a047476_list !! (n-1)

%o a047476_list = [n | n <- [1..], mod n 8 <= 3]

%o -- _Reinhard Zumkeller_, Dec 29 2012

%o (PARI) x='x+O('x^100); concat(0, Vec(x^2*(1+x+x^2+5*x^3)/((1-x)^2*(1+x)*(1+x^2)))) \\ _Altug Alkan_, Dec 24 2015

%Y Cf. A033203 (primes), A047467, A047471.

%K nonn,easy

%O 1,3

%A _N. J. A. Sloane_