OFFSET
0,3
REFERENCES
H. Gupta, Magic partitions, I, Math. Student 45 (1977), no. 3, 58-62.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,2,-1,-2,-1,2,1,-1).
FORMULA
a(0)=1, a(1)=0, a(2)=4, a(3)=5, a(4)=13, a(5)=17, a(6)=33, a(7)=41, a(n)=a(n-1)+2*a(n-2)-a(n-3)-2*a(n-4)-a(n-5)+2*a(n-6)+a(n-7)-a(n-8). - Harvey P. Dale, May 17 2013
MATHEMATICA
CoefficientList[Series[(1-x+2x^2+2x^3+2x^4-x^5+x^6)/((1-x) (1-x^2)^2 (1-x^3)), {x, 0, 60}], x] (* or *) LinearRecurrence[{1, 2, -1, -2, -1, 2, 1, -1}, {1, 0, 4, 5, 13, 17, 33, 41}, 60] (* Harvey P. Dale, May 17 2013 *)
PROG
(Magma) I:=[1, 0, 4, 5, 13, 17, 33, 41]; [n le 8 select I[n] else Self(n-1)+2*Self(n-2)-Self(n-3)-2*Self(n-4)-Self(n-5)+2*Self(n-6)+Self(n-7)-Self(n-8): n in [1..50]]; // Vincenzo Librandi, Sep 09 2016
(PARI) Vec((1-x+2*x^2+2*x^3+2*x^4-x^5+x^6)/((1-x)*(1-x^2)^2*(1-x^3)) + O(x^99)) \\ Altug Alkan, Sep 09 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jun 15 2003
STATUS
approved