OFFSET
1,1
COMMENTS
Let b(n) be the sequence (0,0,0,3,8,20,36,...), with offset 0. Then b(n) is the number of triples (w,x,y) having all terms in {0,...,n} and w < range{w,x,y}. - Clark Kimberling, Jun 11 2012
Consider a(n) with two 0's prepended and offset 1. Call the new sequence b(n) and consider the partitions of n into two parts (p,q). Then b(n) represents the sum of all the products (p + q) * (q - p) where p <= q. - Wesley Ivan Hurt, Apr 12 2018
LINKS
Iain Fox, Table of n, a(n) for n = 1..10000 (first 1000 terms from Colin Barker)
Index entries for linear recurrences with constant coefficients, signature (2,1,-4,1,2,-1).
FORMULA
a(n+1) - a(n) = A032438(n+2).
G.f.: x*(3+2*x+x^2) / ( (1+x)^2*(x-1)^4 ). - R. J. Mathar, Jul 01 2011
a(n) = (n+2)*(2*n^2 + 4*n - (-1)^n + 1)/8. - Ilya Gutkovskiy, May 07 2016
From Colin Barker, May 07 2016: (Start)
a(n) = (n^3 + 4*n^2 + 4*n)/4 for n even.
a(n) = (n^3 + 4*n^2 + 5*n + 2)/4 for n odd.
a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6) for n > 6. (End)
a(n) = Sum_{k=1..n+1} floor((n+1)*k/2). - Wesley Ivan Hurt, Apr 01 2017
a(n) = (n+2)*floor((n+1)^2/4) ( = (n+2)*A002620(n+1) ) for n > 0. - Heinrich Ludwig, Dec 22 2017
E.g.f.: e^(-x) * (-2 + x + e^(2*x)*(2 + 19*x + 14*x^2 + 2*x^3))/8. - Iain Fox, Dec 29 2017
EXAMPLE
First diagonal 3 = 3.
Second diagonal 8 = 8.
Third diagonal 5+15 = 20.
Fourth diagonal 24+12 = 36.
MATHEMATICA
Rest@ CoefficientList[Series[x (3 + 2 x + x^2)/((1 + x)^2*(x - 1)^4), {x, 0, 44}], x] (* Michael De Vlieger, Dec 22 2017 *)
LinearRecurrence[{2, 1, -4, 1, 2, -1}, {3, 8, 20, 36, 63, 96}, 60] (* Vincenzo Librandi, Jan 22 2018 *)
PROG
(PARI) Vec(x*(3+2*x+x^2)/((1+x)^2*(x-1)^4) + O(x^50)) \\ Colin Barker, May 07 2016
(Magma) [(n+2)*(2*n^2+4*n-(-1)^n+1)/8: n in [1..50]]; // Vincenzo Librandi, Jan 22 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Sep 01 2008
STATUS
approved