OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (2,-1,0,1,-2,1).
FORMULA
a(n) = Sum_{i=1..n} A047527(i).
From G. C. Greubel, Sep 04 2018: (Start)
a(n) = (4*n^2 + 2*n - 3 + 2*(1 + (-1)^n)*I^n - (-1)^n)/4, where I = sqrt(-1).
G.f.: x*(1+x+5*x^2+x^3)/((1-x)^2*(1-x^4)).
E.g.f.: (2*cos(x) +(2*x^2 +3*x -1)*sinh(x) +(2*x^2 +3*x -2)*cosh(x))/2. (End)
MATHEMATICA
Accumulate[Select[Range[120], MemberQ[{0, 1, 2, 7}, Mod[#, 8]]&]] (* Harvey P. Dale, Mar 08 2011 *)
Table[(4*n^2 +2*n -3 +2*(1 +(-1)^n)*I^n -(-1)^n)/4, {n, 1, 100}] (* G. C. Greubel, Sep 04 2018 *)
PROG
(PARI) vector(100, n, (4*n^2 +2*n -3 +2*(1 +(-1)^n)*I^n -(-1)^n)/4) \\ G. C. Greubel, Sep 04 2018
(PARI) x='x+O('x^99); Vec(x*(1+x+5*x^2+x^3)/((1-x)^2*(1-x^4))) \\ Altug Alkan, Sep 05 2018
(Magma) C<I> := ComplexField(); [Round((4*n^2 +2*n -3 +2*(1 +(-1)^n)*I^n -(-1)^n)/4): n in [1..100]]; // G. C. Greubel, Sep 04 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, Dec 19 2009
STATUS
approved