A131756 Period 3: repeat [2, -1, 3].
2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3, 2, -1, 3
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,0,1).
Crossrefs
Cf. A130784.
Programs
-
Magma
&cat [[2, -1, 3]^^30]; // Wesley Ivan Hurt, Jul 01 2016
-
Maple
seq(op([2, -1, 3]), n=0..50); # Wesley Ivan Hurt, Jul 01 2016
-
Mathematica
PadRight[{}, 100, {2, -1, 3}] (* Wesley Ivan Hurt, Jul 01 2016 *)
-
PARI
a(n)=[2,-1,3][1+n%3] \\ Jaume Oliver Lafont, Mar 24 2009
Formula
a(n) = 4/3+2/3*cos(2/3*Pi*n)-4/3*3^(1/2)*sin(2/3*Pi*n). - R. J. Mathar, Nov 15 2007
G.f.: (2-x+3*x^2)/(1-x^3). - Jaume Oliver Lafont, Mar 24 2009
a(n) = a(n-3) for n>2. - Wesley Ivan Hurt, Jul 01 2016