%I #17 Dec 12 2023 09:36:11
%S 1,-1,-3,-3,-1,1,1,-1,-3,-3,-1,1,1,-1,-3,-3,-1,1,1,-1,-3,-3,-1,1,1,-1,
%T -3,-3,-1,1,1,-1,-3,-3,-1,1,1,-1,-3,-3,-1,1,1,-1,-3,-3,-1,1,1,-1,-3,
%U -3,-1,1,1,-1,-3,-3,-1,1,1,-1,-3,-3,-1,1,1,-1,-3,-3
%N Period 6: repeat [1, -1, -3, -3, -1, 1].
%C With offset 1, a(n) satisfies the interesting recurrence: a(n+1) = Sum_{k=1..n} binomial(n, k)*(-1)^k*a(k); see Mathematica code below. - _John M. Campbell_, May 05 2012
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (2,-2,1).
%F From _Wesley Ivan Hurt_, Jun 19 2016: (Start)
%F G.f.: (1-3*x+x^2)/(1-2*x+2*x^2-x^3).
%F a(n) = 2*a(n-1) - 2*a(n-2) + a(n-3) for n>2.
%F a(n) = (6*cos(n*Pi/3) - 2*sqrt(3)*sin(n*Pi/3) - 3)/3. (End)
%p A130778:=n->[1, -1, -3, -3, -1, 1][(n mod 6)+1]: seq(A130778(n), n=0..100); # _Wesley Ivan Hurt_, Jun 19 2016
%t Table1 = {1}; a[1] = 1; n = 1; While[n < 314, a[n + 1] = Sum[Binomial[n, k]*(-1)^k*a[k], {k, 1, n}]; AppendTo[Table1, a[n + 1]]; n++]; Print[Table1] (* _John M. Campbell_, May 05 2012 *)
%t PadRight[{}, 200, {1, -1, -3, -3, -1, 1}] (* _Wesley Ivan Hurt_, Jun 19 2016 *)
%o (Magma) &cat[[1, -1, -3, -3, -1, 1]^^20]; // _Wesley Ivan Hurt_, Jun 19 2016
%K sign,easy
%O 0,3
%A _Paul Curtz_, Jul 14 2007