A132951 Period 6: repeat [1, 3, 1, -1, -3, -1].
1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1, 1, 3, 1, -1, -3, -1
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,0,-1).
Programs
-
Magma
&cat [[1, 3, 1, -1, -3, -1]: n in [0..20]]; // Wesley Ivan Hurt, Nov 18 2022
-
Mathematica
PadRight[{},120,{1,3,1,-1,-3,-1}] (* Harvey P. Dale, Feb 26 2024 *)
-
PARI
a(n)=[1,3,1,-1,-3,-1][n%6+1] \\ Charles R Greathouse IV, Jun 02 2011
Formula
a(n) = 3*a(n-1)-a(n-3)+3*a(n-4).
O.g.f.: (1+3*x+x^2)/((x+1)*(x^2-x+1)) = -(1/3)/(x+1)+(1/3)*(4*x+4)/(x^2-x+1). - R. J. Mathar, Nov 28 2007
a(n) = -(1/3)*(-1)^n+(4/3)*cos(Pi*n/3)+(4*3^0.5/3)*sin(Pi*n/3). - Richard Choulet, Jan 02 2008
Extensions
Edited by N. J. A. Sloane, May 16 2008 at the suggestion of R. J. Mathar.