OFFSET
1,2
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Leonard F. Klosinski, Gerald L. Alexanderson and Loren C. Larson, The Fifty-Seventh William Lowell Putnam Competition, Amer. Math. Monthly, 104, 1997, 744-754, Problem B-3.
Vasile Mihai and Michael Woltermann, Problem 10725: The Smoothest and Roughest Permutations, Amer. Math. Monthly, 108 (March 2001), pp. 272-273.
Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
FORMULA
a(1)=1; a(n)=(2n^3+3n^2-11n+18)/6 for n>=2.
G.f.: x*(1+x)*(1-x+2*x^2-x^3)/(1-x)^4. [Colin Barker, Jul 24 2012]
EXAMPLE
a(4)=25 because the values of the sum for the permutations of {1,2,3,4} are 21 (8 times), 24 (8 times) and 25 (8 times).
MAPLE
a:=proc(n) if n=1 then 1 else (2*n^3+3*n^2-11*n+18)/6 fi end: seq(a(n), n=1..50);
MATHEMATICA
Rest@ CoefficientList[Series[x (1 + x) (1 - x + 2 x^2 - x^3)/(1 - x)^4, {x, 0, 42}], x] (* Michael De Vlieger, Jan 29 2022 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Emeric Deutsch, Jul 30 2005
STATUS
approved