%I #25 Sep 08 2022 08:45:53
%S 4,5,7,2,1,8,4,5,7,2,1,8,4,5,7,2,1,8,4,5,7,2,1,8,4,5,7,2,1,8,4,5,7,2,
%T 1,8,4,5,7,2,1,8,4,5,7,2,1,8,4,5,7,2,1,8,4,5,7,2,1,8,4,5,7,2,1,8,4,5,
%U 7,2,1,8,4,5,7,2,1,8,4,5,7,2,1,8,4,5
%N Period 6: repeat [4, 5, 7, 2, 1, 8].
%C Represents also the decimal expansion of 16934/37037 and the continued fractions of 0.23839... = (sqrt(496555)-667)/158 or of 4.194699... = (667+sqrt(496555))/327. - _R. J. Mathar_, Dec 20 2010
%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) = A166304(n) mod 9 = A022998(3n+2) mod 9.
%F a(2n) + a(2n+1) = 9.
%F G.f.: (4+5*x+7*x^2+2*x^3+x^4+8*x^5) / ( (1-x)*(1+x)*(1+x+x^2)*(x^2-x+1) ). - _R. J. Mathar_, Dec 20 2010
%F From _Wesley Ivan Hurt_, Jun 18 2016: (Start)
%F a(n) = a(n-6) for n>5.
%F a(n) = (9 -cos(n*Pi) + 3*cos(n*Pi/3) - 3*cos(2*n*Pi/3) + sqrt(3)*sin(n*Pi/3) - 3*sqrt(3)*sin(2*n*Pi/3))/2. (End)
%p A177883:=n->[4, 5, 7, 2, 1, 8][(n mod 6)+1]: seq(A177883(n), n=0..100); # _Wesley Ivan Hurt_, Jun 18 2016
%t PadRight[{}, 120, {4,5,7,2,1,8}] (* _Harvey P. Dale_, Feb 11 2016 *)
%o (Magma) &cat[[4, 5, 7, 2, 1, 8]: n in [0..20]]; // _Wesley Ivan Hurt_, Jun 18 2016
%o (PARI) a(n)=[4, 5, 7, 2, 1, 8][n%6+1] \\ _Charles R Greathouse IV_, Jul 17 2016
%Y Cf. A173598, A141425, A153130 (permutations).
%K nonn,easy
%O 0,1
%A _Paul Curtz_, Dec 14 2010