OFFSET
1,2
REFERENCES
Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 62.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
a(1)=1, a(2)=9, a(3)=17, a(4)=3, a(n) = a(n-1)+a(n-3)-a(n-4). - Harvey P. Dale, Feb 24 2014
G.f.: x*(1+8*x+8*x^2-15*x^3) / ((x-1)^2*(x^2+x+1)). - Colin Barker, Sep 12 2014
MATHEMATICA
RecurrenceTable[{a[1]==1, a[2]==9, a[3]==17, a[n]==a[n-3]+2}, a, {n, 70}] (* or *) LinearRecurrence[{1, 0, 1, -1}, {1, 9, 17, 3}, 70] (* Harvey P. Dale, Feb 24 2014 *)
PROG
(PARI) Vec(-x*(15*x^3-8*x^2-8*x-1)/((x-1)^2*(x^2+x+1)) + O(x^100)) \\ Colin Barker, Sep 12 2014
(Magma) I:=[1, 9, 17, 3]; [n le 4 select I[n] else Self(n-1)+Self(n-3)-Self(n-4): n in [1..30]]; // G. C. Greubel, Dec 30 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Nathaniel Johnston, May 08 2011
STATUS
approved