Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #26 Mar 08 2024 01:12:00
%S 1,5,3,1,1,5,3,1,1,5,3,1,1,5,3,1,1,5,3,1,1,5,3,1,1,5,3,1,1,5,3,1,1,5,
%T 3,1,1,5,3,1,1,5,3,1,1,5,3,1,1,5,3,1,1,5,3,1,1,5,3,1,1,5,3,1,1,5,3,1,
%U 1,5,3,1,1,5,3,1,1,5,3,1,1,5,3,1,1,5,3,1
%N Period 4: repeat [1, 5, 3, 1].
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,1).
%F Final digits of A082311.
%F O.g.f.: (1+5*x+3*x^2+x^3)/((1-x)*(x+1)*(1+x^2)) = (5/2)/(1-x)-(1/2)/(x+1)+(2*x-1)/(1+x^2). - _R. J. Mathar_, Nov 28 2007
%F From _Wesley Ivan Hurt_, Jul 09 2016: (Start)
%F a(n) = a(n-4) for n>3.
%F a(n) = (5-cos(n*Pi)-2*cos(n*Pi/2)+4*sin(n*Pi/2)-I*sin(n*Pi))/2. (End)
%p seq(op([1, 5, 3, 1]), n=0..40); # _Wesley Ivan Hurt_, Jul 09 2016
%t PadRight[{}, 120, {1,5,3,1}] (* _Harvey P. Dale_, Sep 15 2014 *)
%o (PARI) a(n)=[1,5,3,1][n%4+1] \\ _Charles R Greathouse IV_, Jun 02 2011
%o (Magma) &cat [[1, 5, 3, 1]^^30]; // _Wesley Ivan Hurt_, Jul 09 2016
%Y Cf. A082311.
%K nonn,easy
%O 0,2
%A _Paul Curtz_, Nov 20 2007