%I #13 Dec 12 2023 08:07:18
%S 7,5,1,-7,-5,-1,7,5,1,-7,-5,-1,7,5,1,-7,-5,-1,7,5,1,-7,-5,-1,7,5,1,-7,
%T -5,-1,7,5,1,-7,-5,-1,7,5,1,-7,-5,-1,7,5,1,-7,-5,-1,7,5,1,-7,-5,-1,7,
%U 5,1,-7,-5,-1,7,5,1,-7,-5,-1,7,5,1,-7,-5,-1,7,5,1,-7,-5,-1,7,5,1,-7,-5,-1,7,5,1
%N Period 6: repeat [7, 5, 1, -7, -5, -1].
%C The sequence b(n) = (-A153130(n)) mod 9 = A153130(n+3) = A146501(n-1) = 8, 7, 5, 1, 2, 4,... has period length 6. This here is a(n)=b(n)-A153130(n).
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,-1).
%F a(n) = -a(n-3) for n>2; G.f.: (7+5*x+x^2)/((1+x)*(1-x+x^2)). [_R. J. Mathar_, Jan 23 2009]
%F a(n) = cos(n*Pi) + 6*cos(n*Pi/3) + 2*sqrt(3)*sin(n*Pi/3). - _Wesley Ivan Hurt_, Jun 20 2016
%p A154870:=n->[7, 5, 1, -7, -5, -1][(n mod 6)+1]: seq(A154870(n), n=0..100); # _Wesley Ivan Hurt_, Jun 20 2016
%t PadRight[{}, 100, {7, 5, 1, -7, -5, -1}] (* _Wesley Ivan Hurt_, Jun 20 2016 *)
%o (Magma) &cat [[7, 5, 1, -7, -5, -1]^^20]; // _Wesley Ivan Hurt_, Jun 20 2016
%Y Cf. A146501, A153130.
%K sign,easy
%O 0,1
%A _Paul Curtz_, Jan 16 2009
%E Edited and extended by _R. J. Mathar_, Jan 23 2009