OFFSET
0,3
COMMENTS
For a guide to related sequences, see A211795.
Partial sums of A033994. - J. M. Bergot, Jun 14 2013
LINKS
Index entries for linear recurrences with constant coefficients, signature (5,-10,10,-5,1).
FORMULA
a(n) = 5*a(n-1) - 10*a(n-2) + 10*a(n-3) - 5*a(n-4) + a(n-5) for n > 4.
G.f.: x^2*(2+3*x)/(1-x)^5. - Bruno Berselli, May 31 2012
a(n) = (n-1)*n*(n+1)*(5*n-2)/24. - Bruno Berselli, May 31 2012
EXAMPLE
a(8)=798 which results from the following: 1*(8+9+10+11+12+13+14) + 2*(8+9+10+11+12+13) + 3*(8+9+10+11+12) + 4*(8+9+10+11) + 5*(8+9+10) + 6*(8+9) + 7*(8) = 798 = 77+126+150+152+135+102+56. - J. M. Bergot, Aug 23 2022
MAPLE
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[w > x < y >= z, s = s + 1],
{w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]];
Map[t[#] &, Range[0, 40]] (* A212501 *)
LinearRecurrence[{5, -10, 10, -5, 1}, {0, 0, 2, 13, 45}, 50] (* Harvey P. Dale, May 01 2023 *)
PROG
(PARI) a(n)=n*(n-1)*(n+1)*(5*n-2)/24 \\ Charles R Greathouse IV, Jun 14 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 19 2012
STATUS
approved