OFFSET
1,1
COMMENTS
Fifth column of triangular array T defined in A131022.
LINKS
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
MATHEMATICA
PadRight[{}, 120, {11, 5, 2, 5, 11, 14}] (* or *) LinearRecurrence[{2, -2, 1}, {11, 5, 2}, 120] (* Harvey P. Dale, Jun 12 2017 *)
PROG
(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))), ", "))}
(Magma) m:=84; [ [11, 5, 2, 5, 11, 14][(n-1) mod 6 + 1]: n in [1..m] ];
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Klaus Brockhaus, following a suggestion of Paul Curtz, Jun 10 2007
STATUS
approved