login
a(4n) = a(4n+1) = 0, a(4n+2) = 3n+1, a(4n+3) = 3n+2.
1

%I #12 Oct 06 2017 07:16:39

%S 0,0,1,2,0,0,4,5,0,0,7,8,0,0,10,11,0,0,13,14,0,0,16,17,0,0,19,20,0,0,

%T 22,23,0,0,25,26,0,0,28,29,0,0,31,32,0,0,34,35,0,0,37,38,0,0,40,41,0,

%U 0,43,44,0,0,46,47,0,0,49,50,0,0,52,53,0,0,55,56,0,0,58,59,0,0,61,62,0,0,64

%N a(4n) = a(4n+1) = 0, a(4n+2) = 3n+1, a(4n+3) = 3n+2.

%H Michael De Vlieger, <a href="/A131742/b131742.txt">Table of n, a(n) for n = 0..10000</a>

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

%F a(n) = (1/16)*(cos(n*Pi/2)+sin(n*Pi/2)-1)*((6n-3)*cos(n*Pi/2)+cos(n*Pi)+(6n-3)*sin(n*Pi/2)). - _Wesley Ivan Hurt_, Sep 24 2017

%F From _Colin Barker_, Oct 06 2017: (Start)

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

%F a(n) = a(n-1) - a(n-2) + a(n-3) + a(n-4) - a(n-5) + a(n-6) - a(n-7) for n>6.

%F (End)

%t Table[Switch[Mod[n, 4], 2, 3 (n - 2)/4 + 1, 3, 3 (n - 3)/4 + 2, _, 0], {n, 0, 86}] (* _Michael De Vlieger_, Sep 25 2017 *)

%o (PARI) concat(vector(2), Vec(x^2*(1 + x - x^2 + x^3 + x^4) / ((1 - x)^2*(1 + x)*(1 + x^2)^2) + O(x^100))) \\ _Colin Barker_, Oct 06 2017

%K nonn,easy

%O 0,4

%A _Paul Curtz_, Sep 20 2007