A131029 Periodic sequence (11, 5, 2, 5, 11, 14).
11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14
Offset: 1
Links
- Index entries for linear recurrences with constant coefficients, signature (2,-2,1).
Programs
-
Magma
m:=84; [ [11, 5, 2, 5, 11, 14][(n-1) mod 6 + 1]: n in [1..m] ];
-
Mathematica
PadRight[{},120,{11,5,2,5,11,14}] (* or *) LinearRecurrence[{2,-2,1},{11,5,2},120] (* Harvey P. Dale, Jun 12 2017 *)
-
PARI
{m=84; for(n=1, m, r=(n-1)%6; print1(if(r==0||r==4, 11, if(r==2, 2, if(r==5, 14, 5))), ","))}
-
Python
def a(n): return [11, 5, 2, 5, 11, 14][n%6] print([a(n) for n in range(84)]) # Michael S. Branicky, Nov 05 2021
Formula
a(1) = a(5) = 11, a(2) = a(4) = 5, a(3) = 2, a(6) = 14; for n > 6, a(n) = a(n-6).
G.f.: (11-17*x+14*x^2)/((1-x)*(1-x+x^2)).
a(n) = 3*cos((n-1)/3*Pi)-3*sqrt(3)*sin((n-1)/3*Pi)+8. - Leonid Bedratyuk, May 13 2012
Comments