OFFSET
0,1
COMMENTS
REFERENCES
P. Curtz, Exercise Book, manuscript, 1995.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000 (terms 0..300 from Vincenzo Librandi)
Index entries for linear recurrences with constant coefficients, signature (3,-3,2).
FORMULA
MATHEMATICA
CoefficientList[Series[(3-5*x+4*x^2)/((1-2*x)*(1-x+x^2)), {x, 0, 50}], x] (* or *) LinearRecurrence[{3, -3, 2}, {3, 4, 7}, 30] (* G. C. Greubel, Jan 15 2018 *)
PROG
(Magma) m:=31; S:=[ [3, 1, 2][(n-1) mod 3 +1]: n in [1..m] ]; [ &+[ Binomial(i-1, k-1)*S[k]: k in [1..i] ]: i in [1..m] ]; // Klaus Brockhaus, Aug 03 2007
(Magma) I:=[3, 4, 7]; [n le 3 select I[n] else 3*Self(n-1) - 3*Self(n-2) + 2*Self(n-3): n in [1..30]]; // G. C. Greubel, Jan 15 2018
(PARI) {m=31; v=vector(m); v[1]=3; v[2]=4; v[3]=7; for(n=4, m, v[n]=3*v[n-1]-3*v[n-2]+2*v[n-3]); v} \\ Klaus Brockhaus, Aug 03 2007
(PARI) {for(n=0, 30, print1(2^(n+1)+[1, 0, -1, -1, 0, 1][n%6+1], ", "))} \\ Klaus Brockhaus, Aug 03 2007
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Jul 13 2007
EXTENSIONS
Edited and extended by Klaus Brockhaus, Aug 03 2007
STATUS
approved