A140430 Period 6: repeat [3, 2, 4, 1, 2, 0].
3, 2, 4, 1, 2, 0, 3, 2, 4, 1, 2, 0, 3, 2, 4, 1, 2, 0, 3, 2, 4, 1, 2, 0, 3, 2, 4, 1, 2, 0, 3, 2, 4, 1, 2, 0, 3, 2, 4, 1, 2, 0, 3, 2, 4, 1, 2, 0, 3, 2, 4, 1, 2, 0, 3, 2, 4, 1, 2, 0, 3, 2, 4, 1, 2, 0, 3, 2, 4, 1, 2, 0, 3, 2, 4, 1, 2, 0, 3, 2, 4, 1, 2, 0, 3, 2
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (1,0,-1,1).
Crossrefs
Programs
-
Magma
[2 + ((-n-2) mod 3)*(-1)^n : n in [0..100]]; // Wesley Ivan Hurt, Aug 29 2014
-
Maple
A140430:=n->2+((-n-2) mod 3)*(-1)^n: seq(A140430(n), n=0..100); # Wesley Ivan Hurt, Aug 29 2014
-
Mathematica
CoefficientList[Series[(3 - x + 2 x^2)/((1 - x)*(1 + x^3)), {x, 0, 30}], x] (* Wesley Ivan Hurt, Aug 29 2014 *) PadRight[{},120,{3,2,4,1,2,0}] (* Harvey P. Dale, Jan 21 2023 *)
-
PARI
a(n)=[3,2,4,1,2,0][n%6+1] \\ Charles R Greathouse IV, Jun 02 2011
Formula
From Wesley Ivan Hurt, Aug 29 2014: (Start)
G.f.: (3-x+2*x^2)/((1-x)*(1+x^3)).
a(n) = a(n-1)-a(n-3)+a(n-4);
a(n) = 2 + ((-n-2) mod 3) * (-1)^n. (End)
a(n) = (6 + 3*cos(n*Pi) + 2*sqrt(3)*sin(n*Pi/3))/3. - Wesley Ivan Hurt, Jun 20 2016
Extensions
More terms from Wesley Ivan Hurt, Aug 29 2014
Comments