OFFSET
0,1
COMMENTS
Nonsimple continued fraction expansion of (7 + 3*sqrt(5))/2 = 6.85410196624... = 1 + A090550. - R. J. Mathar, Mar 08 2012
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
LINKS
Index entries for linear recurrences with constant coefficients, signature (-1,-1,-1).
FORMULA
G.f.: (3 + 4*x + 3*x^2)/((1+x)*(1+x^2)). - Jaume Oliver Lafont, Aug 30 2009
a(n) = (-1)^n + 2(-1)^((2n + (-1)^n - 1)/4). - Brad Clardy, Mar 10 2013
a(n) = 3 - 2*(n mod 4). - Joerg Arndt, Mar 10 2013
a(n) = (-1)^n + 2(-1)^floor(n/2). - Wesley Ivan Hurt, Apr 17 2014
From Wesley Ivan Hurt, Jul 10 2016: (Start)
a(n) + a(n-1) + a(n-2) + a(n-3) = 0 for n>2, a(n) = a(n-4) for n>3.
a(n) = 2*cos(n*Pi/2) + cos(n*Pi) + 2*sin(n*Pi/2). (End)
MAPLE
MATHEMATICA
PadRight[{}, 104, {3, 1, -1, -3}] (* Harvey P. Dale, Nov 12 2011 *)
PROG
(PARI) a(n)=3-2*(n%4) \\ Jaume Oliver Lafont, Aug 28 2009
(Haskell)
a132429 = (3 -) . (* 2) . (`mod` 4)
a132429_list = cycle [3, 1, -1, -3] -- Reinhard Zumkeller, Aug 15 2015
(Magma) &cat [[3, 1, -1, -3]^^30]; // Wesley Ivan Hurt, Jul 10 2016
(Python)
def A132429(n): return 3 - 2*(n & 3) # Chai Wah Wu, May 25 2022
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Paul Curtz, Nov 13 2007
STATUS
approved