OFFSET
1,4
COMMENTS
a(n+1) = Sum_{pi in Symm(n)} Sum_{i=1..n} max(pi(i)-i,0)^2, i.e., the sum of the squares of the positive displacement of all letters in all permutations on n letters. - Franklin T. Adams-Watters, Oct 25 2006
REFERENCES
Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 156.
John Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 44.
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..300
FORMULA
E.g.f.: ((x/(1-x))^3)/3!.
If we define f(n,i,x) = Sum_{k=i..n} (Sum_{j=i..k} binomial(k,j) * Stirling1(n,k) * Stirling2(j,i)*x^(k-j)) then a(n+1) = (-1)^n*f(n,2,-4), n >= 2. - Milan Janjic, Mar 01 2009
a(n) = Sum_{k>=1} k * A260665(n,k). - Alois P. Heinz, Nov 14 2015
D-finite with recurrence (-n+5)*a(n) + (n-2)*(n-3)*a(n-1) = 0, n >= 4. - R. J. Mathar, Jan 06 2021
From Amiram Eldar, May 02 2022: (Start)
MAPLE
[seq(n!*binomial(n-1, 2)/6, n=1..40)];
MATHEMATICA
Table[(n-2)*(n-1)*n!/12, {n, 21}] (* Arkadiusz Wesolowski, Nov 26 2012 *)
With[{nn=30}, CoefficientList[Series[(x/(1-x))^3/6, {x, 0, nn}], x] Range[0, nn]!] (* Harvey P. Dale, Oct 04 2017 *)
PROG
(Magma) [Factorial(n)*Binomial(n-1, 2)/6: n in [1..25]]; // Vincenzo Librandi, Oct 11 2011
(Sage) [factorial(n-1)*binomial(n, 3)/2 for n in (1..30)] # G. C. Greubel, May 10 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved