A076840 a(1) = a(2) = 1; a(n) = (a(n-1) + 1)/a(n-2) (for n>2, n odd), (a(n-1)^2 + 1)/a(n-2) (for n>2, n even).
1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2
Offset: 1
Links
- Sergey Fomin and Andrei Zelevinsky, Cluster algebras II: Finite type classification, arXiv:math/0208229 [math.RA], 2002-2003.
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,1).
Programs
-
Maple
a := 1; b := 1; f := proc(n) option remember; global a,b; if n=1 then RETURN(a); fi; if n=2 then RETURN(b); fi; if n mod 2 = 1 then RETURN((f(n-1)+1)/f(n-2)); fi; RETURN((f(n-1)^2+1)/f(n-2)); end;
-
Mathematica
LinearRecurrence[{0, 0, 0, 0, 0, 1}, {1, 1, 2, 5, 3, 2}, 105] (* Jean-François Alcover, Nov 22 2017 *)
Comments