cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A158459 Period 4: repeat [0, 3, 2, 1].

This page as a plain text file.
%I A158459 #55 Dec 12 2023 08:04:48
%S A158459 0,3,2,1,0,3,2,1,0,3,2,1,0,3,2,1,0,3,2,1,0,3,2,1,0,3,2,1,0,3,2,1,0,3,
%T A158459 2,1,0,3,2,1,0,3,2,1,0,3,2,1,0,3,2,1,0,3,2,1,0,3,2,1,0,3,2,1,0,3,2,1,
%U A158459 0,3,2,1,0,3,2,1,0,3,2,1,0,3,2,1,0,3,2
%N A158459 Period 4: repeat [0, 3, 2, 1].
%H A158459 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,1).
%F A158459 G.f.: x*(x^2+2*x+3)/(1-x^4).
%F A158459 a(n) = A102370(n) (mod 4).
%F A158459 a(n) = 3/2-(-1)^n/2+sin(n*Pi/2)-cos(n*Pi/2). - _Richard Choulet_, Apr 07 2009
%F A158459 a(n) = -n (mod 4). - _M. F. Hasler_, Jan 13 2012; formula simplified by _Arkadiusz Wesolowski_, Jul 03 2012
%F A158459 a(n) = (3-(-1)^n-2*I^(n*(n+1)))/2. - _Bruno Berselli_, Jul 03 2012
%F A158459 a(n) = floor(107/3333*10^(n+1)) mod 10. - _Hieronymus Fischer_, Jan 04 2013
%F A158459 a(n) = floor(19/85*4^(n+1)) mod 4. - _Hieronymus Fischer_, Jan 04 2013
%F A158459 a(n) = ((n+1) mod 4)+(-1)^((n+1) mod 4). - _Wesley Ivan Hurt_, May 18 2014
%F A158459 a(n) = 3*n mod 4. - _Gary Detlefs_, May 24 2014
%F A158459 a(n) = a(n-4) for n>3. - _Wesley Ivan Hurt_, Jul 09 2016
%p A158459 seq(op([0, 3, 2, 1]), n=0..50); # _Wesley Ivan Hurt_, Jul 09 2016
%t A158459 Flatten@Table[{0, 3, 2, 1}, {22}] (* _Arkadiusz Wesolowski_, Jul 03 2012 *)
%o A158459 (PARI) A158459(n)=(-n)%4 \\ _M. F. Hasler_, Jan 13 2012
%o A158459 (Haskell)
%o A158459 a158459 = (`mod` 4) . negate
%o A158459 a158459_list = cycle [0,3,2,1]  -- _Reinhard Zumkeller_, Feb 22 2013
%o A158459 (Magma) &cat [[0, 3, 2, 1]^^30]; // _Wesley Ivan Hurt_, Jul 09 2016
%Y A158459 Cf. A010873, A102370.
%K A158459 nonn,easy
%O A158459 0,2
%A A158459 _Philippe Deléham_, Mar 19 2009
%E A158459 Better definition from _M. F. Hasler_, Jan 13 2012