login
Hexaperiodic [0, 1, 0, 1, 0, -1].
1

%I #15 Jun 09 2024 10:25:38

%S 0,1,0,1,0,-1,0,1,0,1,0,-1,0,1,0,1,0,-1,0,1,0,1,0,-1,0,1,0,1,0,-1,0,1,

%T 0,1,0,-1,0,1,0,1,0,-1,0,1,0,1,0,-1,0,1,0,1,0,-1,0,1,0,1,0,-1,0,1,0,1,

%U 0,-1,0,1,0,1,0,-1,0,1,0,1,0,-1,0,1,0,1,0,-1,0,1,0,1,0,-1,0,1,0,1,0,-1,0,1,0,1,0,-1,0,1,0,1,0,-1,0,1,0,1,0,-1,0,1,0,1,0

%N Hexaperiodic [0, 1, 0, 1, 0, -1].

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

%F From _Wesley Ivan Hurt_, Apr 06 2015: (Start)

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

%F Recurrence: a(n) = a(n-6).

%F a(n) = (1-(-1)^n)*(-1)^floor(2n/3)/2.

%F abs(a(n)) = A000035(n). (End)

%e G.f. = x + x^3 - x^5 + x^7 + x^9 - x^11 + x^13 + x^15 - x^17 + x^19 + x^21 + ...

%p A131734:=n->(1-(-1)^n)*(-1)^floor(2*n/3)/2: seq(A131734(n), n=0..100); # _Wesley Ivan Hurt_, Apr 06 2015

%t CoefficientList[Series[x (1 + x^2 - x^4)/(1 - x^6), {x, 0, 100}], x] (* _Wesley Ivan Hurt_, Apr 06 2015 *)

%t PadRight[{},120,{0,1,0,1,0,-1}] (* _Harvey P. Dale_, Jun 09 2024 *)

%o (Magma) [(1-(-1)^n)*(-1)^Floor(2*n/3)/2 : n in [0..100]]; // _Wesley Ivan Hurt_, Apr 06 2015

%o (PARI) {a(n) = [ 0, 1, 0, 1, 0, -1, 0, 1][n%6 + 1]}; /* _Michael Somos_, Nov 11 2015 */

%Y Cf. A000035 (absolute value).

%K sign,easy

%O 0,1

%A _Paul Curtz_, Sep 19 2007