OFFSET
1,3
COMMENTS
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
Numbers k such that floor(k/4) = 2*floor(k/8). - Bruno Berselli, Oct 05 2017
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
a(n) = 8 * floor(n/4) + (n mod 4), with offset 0.. a(0)=0. - Gary Detlefs, Mar 09 2010
From Colin Barker, May 14 2012: (Start)
a(n) = (-7 - (-1)^n - (1-i)*(-i)^n - (1+i)*i^n + 4*n)/2, where i=sqrt(-1).
G.f.: x^2*(1 + x + x^2 + 5*x^3)/((1 - x)^2*(1 + x)*(1 + x^2)). (End)
a(n) = a(n-1) + a(n-4) - a(n-5). - Vincenzo Librandi, May 16 2012
E.g.f.: 5 + sin(x) - cos(x) + (2*x - 3)*sinh(x) + 2*(x - 2)*cosh(x). - Ilya Gutkovskiy, Jun 01 2016
Sum_{n>=2} (-1)^n/a(n) = (2*sqrt(2)-1)*Pi/16 + 5*log(2)/8. - Amiram Eldar, Dec 19 2021
MAPLE
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
MATHEMATICA
Select[Range[0, 300], MemberQ[{0, 1, 2, 3}, Mod[#, 8]]&] (* Vincenzo Librandi, May 16 2012 *)
LinearRecurrence[{1, 0, 0, 1, -1}, {0, 1, 2, 3, 8}, 100] (* G. C. Greubel, Jun 01 2016 *)
PROG
(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
(Haskell)
a047476 n = a047476_list !! (n-1)
a047476_list = [n | n <- [1..], mod n 8 <= 3]
-- Reinhard Zumkeller, Dec 29 2012
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved