Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #23 Feb 27 2024 03:02:31
%S 1,5,9,5,1,5,9,5,1,5,9,5,1,5,9,5,1,5,9,5,1,5,9,5,1,5,9,5,1,5,9,5,1,5,
%T 9,5,1,5,9,5,1,5,9,5,1,5,9,5,1,5,9,5,1,5,9,5,1,5,9,5,1,5,9,5,1,5,9,5,
%U 1,5,9,5,1,5,9,5,1,5,9,5,1,5,9,5,1,5
%N Period 4: repeat [1, 5, 9, 5].
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1,1).
%F From _R. J. Mathar_, Feb 19 2008: (Start)
%F G.f.: -4/(x^2+1) - 5/(x-1).
%F a(n) = 5 - 4*A056594(n).
%F a(n) = a(n-4) for n>3. (End)
%F From _Wesley Ivan Hurt_, Jul 08 2016: (Start)
%F a(n) = a(n-1) - a(n-2) + a(n-3) for n>2.
%F a(n) = 5 - 4*cos(n*Pi/2). (End)
%F E.g.f.: 5*exp(x) - 4*cos(x). - _G. C. Greubel_, Sep 30 2016
%p seq(op([1, 5, 9, 5]), n=0..50); # _Wesley Ivan Hurt_, Jul 08 2016
%t PadRight[{}, 100, {1, 5, 9, 5}] (* _Wesley Ivan Hurt_, Jul 08 2016 *)
%o (Magma) &cat [[1, 5, 9, 5]^^30]; // _Wesley Ivan Hurt_, Jul 08 2016
%o (PARI) a(n)=([0,1,0; 0,0,1; 1,-1,1]^n*[1;5;9])[1,1] \\ _Charles R Greathouse IV_, Sep 30 2016
%Y Cf. A056594.
%K nonn,easy
%O 0,2
%A _Paul Curtz_, Feb 14 2008