%I #48 Dec 14 2023 05:07:07
%S 0,1,1,2,3,1,0,1,1,2,3,1,0,1,1,2,3,1,0,1,1,2,3,1,0,1,1,2,3,1,0,1,1,2,
%T 3,1,0,1,1,2,3,1,0,1,1,2,3,1,0,1,1,2,3,1,0,1,1,2,3,1,0,1,1,2,3,1,0,1,
%U 1,2,3,1,0,1,1,2,3,1,0,1,1,2,3,1,0,1,1,2,3,1,0,1,1,2,3,1,0,1,1,2,3,1,0,1,1
%N Period 6: repeat [0, 1, 1, 2, 3, 1]; also F(n) mod 4, where F(n) = A000045(n).
%C This sequence shows that every sixth Fibonacci number (A134492) is divisible by 4. - _Alonso del Arte_, Jul 27 2013
%H Vincenzo Librandi, <a href="/A079343/b079343.txt">Table of n, a(n) for n = 0..1000</a>
%H Jon Maiga, <a href="http://jonkagstrom.com/articles/upper_bound_of_fibonacci_entry_points.pdf">Upper bound of Fibonacci entry points</a>, (2019).
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1,1,-1,1).
%F a(n) = 2^(1 - P(3, n) + P(6, n+2))*3^P(6, n+3) - 1, where P(k, n) = floor(1/2*cos(2*n*Pi/k) + 1/2). [_Gary Detlefs_, May 16 2011]
%F a(n) = 4/3 - cos(Pi*n/3) - sin(Pi*n/3)/sqrt(3) - cos(2*Pi*n/3)/3 + sin(2*Pi*n/3)/sqrt(3). - _R. J. Mathar_, Oct 08 2011
%F G.f.: x*(1+2*x^2+x^3) / ( (1-x)*(1-x+x^2)*(1+x+x^2) ). - _R. J. Mathar_, Jul 14 2012
%F a(n) = a(n-1) - a(n-2) + a(n-3) - a(n-4) + a(n-5) for n>4. - _Wesley Ivan Hurt_, Jun 20 2016
%F E.g.f.: 2*(2*exp(x) - sqrt(3)*sin(sqrt(3)*x/2)*sinh(x/2) - cos(sqrt(3)*x/2)*(sinh(x/2) + 2*cosh(x/2)))/3. - _Ilya Gutkovskiy_, Jun 20 2016
%e a(5) = F(5) mod 4 = 5 mod 4 = 1.
%e a(6) = F(6) mod 4 = 8 mod 4 = 0.
%e a(7) = F(7) mod 4 = 13 mod 4 = 1.
%p A079343:=n->[0, 1, 1, 2, 3, 1][(n mod 6)+1]: seq(A079343(n), n=0..100); # _Wesley Ivan Hurt_, Jun 20 2016
%t PadLeft[{}, 108, {0, 1, 1, 2, 3, 1}] (* _Harvey P. Dale_, Aug 10 2011 *)
%t Table[Mod[Fibonacci[n], 4], {n, 0, 127}] (* _Alonso del Arte_, Jul 27 2013 *)
%t LinearRecurrence[{1, -1, 1, -1, 1},{0, 1, 1, 2, 3},105] (* _Ray Chandler_, Aug 27 2015 *)
%o (PARI) for (n=0,100,print1(fibonacci(n)%4","))
%o (Magma) [Fibonacci(n) mod 4: n in [0..100]]; // _Vincenzo Librandi_, Feb 04 2014
%Y Cf. A000045, A079344, A079345, A134492.
%K nonn,easy
%O 0,4
%A _Jon Perry_, Jan 04 2003