%I #57 Dec 12 2023 09:16:45
%S 3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,
%T -3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,
%U -1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1,-1,-3,3,1
%N Period 4: repeat [3, 1, -1, -3].
%C Nonsimple continued fraction expansion of (7 + 3*sqrt(5))/2 = 6.85410196624... = 1 + A090550. - _R. J. Mathar_, Mar 08 2012
%C Pisano period lengths: 1, 1, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, ... . - _R. J. Mathar_, Aug 10 2012
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (-1,-1,-1).
%F G.f.: (3 + 4*x + 3*x^2)/((1+x)*(1+x^2)). - _Jaume Oliver Lafont_, Aug 30 2009
%F a(n) = (-1)^n + 2(-1)^((2n + (-1)^n - 1)/4). - _Brad Clardy_, Mar 10 2013
%F a(n) = 3 - 2*(n mod 4). - _Joerg Arndt_, Mar 10 2013
%F a(n) = (-1)^n + 2(-1)^floor(n/2). - _Wesley Ivan Hurt_, Apr 17 2014
%F From _Wesley Ivan Hurt_, Jul 10 2016: (Start)
%F a(n) + a(n-1) + a(n-2) + a(n-3) = 0 for n>2, a(n) = a(n-4) for n>3.
%F a(n) = 2*cos(n*Pi/2) + cos(n*Pi) + 2*sin(n*Pi/2). (End)
%p A132429:=n->3 - 2 * (n mod 4); seq(A132429(n), n=0..100); # _Wesley Ivan Hurt_, Apr 18 2014
%t PadRight[{}, 104, {3,1,-1,-3}] (* _Harvey P. Dale_, Nov 12 2011 *)
%o (PARI) a(n)=3-2*(n%4) \\ _Jaume Oliver Lafont_, Aug 28 2009
%o (Haskell)
%o a132429 = (3 -) . (* 2) . (`mod` 4)
%o a132429_list = cycle [3, 1, -1, -3] -- _Reinhard Zumkeller_, Aug 15 2015
%o (Magma) &cat [[3, 1, -1, -3]^^30]; // _Wesley Ivan Hurt_, Jul 10 2016
%o (Python)
%o def A132429(n): return 3 - 2*(n & 3) # _Chai Wah Wu_, May 25 2022
%Y Cf. A084101 (1, 3, 3, 1), A090550.
%K sign,easy
%O 0,1
%A _Paul Curtz_, Nov 13 2007