OFFSET
1,2
LINKS
Harry J. Smith, Table of n, a(n) for n=1..1000
Index entries for linear recurrences with constant coefficients, signature (1,3,-3,-3,3,1,-1).
FORMULA
a(2n-1) = n*(n+1)*(7*n-4)/6 (see A007584), a(2n) = n*(n+1)*(7*n+8)/6.
a(n) = sum{k=0..floor((n+1)/2), (n-k+1)ceiling((n-k+1)/2)+k+if(mod(n-k+1, 2) =0, ceiling((n-k+1)/2), 0)}. - Paul Barry, Aug 25 2004
a(n) = sum{k=0..floor(n/2), C(n-k+1,2)+k}; - Paul Barry, Jul 23 2008
a(n) = (2*n+1-(-1)^n)*(2*n+5-(-1)^n)*(14*n+15+17*(-1)^n)/384. - Luce ETIENNE, Feb 17 2015
From Colin Barker, Feb 17 2015: (Start)
a(n) = (7*n^3+30*n^2+32*n)/48 for n even.
a(n) = (7*n^3+27*n^2+17*n-3)/48 for n odd.
G.f.: x*(2*x^2+4*x+1) / ((x-1)^4*(x+1)^3).
(End)
EXAMPLE
a(1)=1, a(2)=2+3=5, a(3)=4+6=10, a(4)=5+7+10=22.
MATHEMATICA
Table[ Sum[ Binomial[n-k+1, 2] + k, {k, 0, Floor[n/2]}], {n, 1, 45}] (* Jean-François Alcover, Sep 16 2013 *)
LinearRecurrence[{1, 3, -3, -3, 3, 1, -1}, {1, 5, 10, 22, 34, 58, 80}, 50] (* Harvey P. Dale, Dec 11 2015 *)
PROG
(PARI) { for (n=1, 1000, a=sum(k=0, n\2, binomial(n - k + 1, 2) + k); write("b064694.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 22 2009
(PARI) Vec(x*(2*x^2+4*x+1)/((x-1)^4*(x+1)^3) + O(x^100)) \\ Colin Barker, Feb 17 2015
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Oct 12 2001
STATUS
approved