%I #24 Sep 08 2022 08:46:08
%S 1,-1,-1,-2,1,-1,-1,1,1,2,-1,1,1,-1,-1,-2,1,-1,-1,1,1,2,-1,1,1,-1,-1,
%T -2,1,-1,-1,1,1,2,-1,1,1,-1,-1,-2,1,-1,-1,1,1,2,-1,1,1,-1,-1,-2,1,-1,
%U -1,1,1,2,-1,1,1,-1,-1,-2,1,-1,-1,1,1,2,-1,1,1,-1
%N a(n) = - (a(n-1)*a(n-4) + a(n-2)*a(n-3)) / a(n-5) with a(0)=1, a(1)=a(2)=-1, a(3)=-2, a(4)=1.
%C Period 12: repeat [1, -1, -1, -2, 1, -1, -1, 1, 1, 2, -1, 1]. - _Wesley Ivan Hurt_, Aug 29 2014
%H Antti Karttunen, <a href="/A242073/b242073.txt">Table of n, a(n) for n = 0..11999</a>
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,-1).
%F a(n) = -a(n+6) = (-1)^n * a(-n), a(2*n) = (-1)^n for all n in Z.
%F a(2*n+1) = - A057079(n). - _Robert Israel_, Aug 29 2014
%F 0 = a(n)*a(n+5) + a(n+1)*a(n+4) + a(n+2)*a(n+3) for all n in Z.
%F G.f.: (1 - x - x^2 - 2*x^3 + x^4 - x^5) / (1 + x^6).
%F G.f. can be written as 1/(1+x^2) + x*(1+x^2)/(1-x^2+x^4). - _Robert Israel_, Aug 29 2014
%F a(n) = ((-1)^(n/2)+(-1)^(3*n/2)+(-1)^((3+n)/6)-(-1)^((3-n)/6)+(-1)^((3-7*n)/6)-(-1)^((3+7*n)/6))/2. - _Wesley Ivan Hurt_, Jul 21 2015
%e G.f. = 1 - x - x^2 - 2*x^3 + x^4 - x^5 - x^6 + x^7 + x^8 + 2*x^9 - x^10 + ...
%p A242073:=proc(n) option remember;
%p if n=0 then 1 elif n=1 then -1 elif n=2 then -1 elif n=3 then -2 elif n=4 then 1 elif n=5 then -1 else -A242073(n-6); fi; end: seq(A242073(n), n=0..100); # _Wesley Ivan Hurt_, Jul 21 2015
%t CoefficientList[Series[(1 - x - x^2 - 2 x^3 + x^4 - x^5)/(1 + x^6), {x, 0, 100}], x] (* _Wesley Ivan Hurt_, Aug 29 2014 *)
%t LinearRecurrence[{0, 0, 0, 0, 0, -1}, {1, -1, -1, -2, 1, -1}, 100] (* _Vincenzo Librandi_, Jul 22 2015 *)
%o (PARI) {a(n) = (-1)^(n\6) * [1, -1, -1, -2, 1, -1][n%6 + 1]};
%o (Magma) I:=[1,-1,-1,-2,1,-1]; [n le 6 select I[n] else -Self(n-6): n in [1..100]]; // _Vincenzo Librandi_, Jul 22 2015
%Y Cf. A057079.
%K sign,easy
%O 0,4
%A _Michael Somos_, Aug 14 2014