login
Ultimately period 4 sequence [ 2, 2, 0, 0, ...] with a(0) = a(1) = 1.
2

%I #21 Nov 20 2023 00:04:00

%S 1,1,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,2,

%T 0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,

%U 2,2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2

%N Ultimately period 4 sequence [ 2, 2, 0, 0, ...] with a(0) = a(1) = 1.

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

%F Euler transform of length 8 sequence [ 1, -1, 0, 2, 0, 0, 0, -1].

%F a(4*n + 2) = a(4*n + 3) = 0. a(4*n) = a(4*n + 1) = 2 unless n < 1.

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

%F a(n) = ((n+2) mod 4) - (n mod 2) - floor(3/(n+2)). - _Wesley Ivan Hurt_, Jun 30 2013

%t PadRight[{1,1},120,{2,2,0,0}] (* _Harvey P. Dale_, Feb 13 2016 *)

%o (PARI) {a(n) = if(n<0, 0, n = n\2; if( n%2, 0, (n>1)+1 ))}

%Y Convolution inverse of A143431.

%K nonn,easy

%O 0,5

%A _Michael Somos_, Aug 14 2008, Sep 18 2008