OFFSET
1,2
COMMENTS
A277406(n) = (n!)^2 + a(n).
The sum of all permutations of the compositions of functions (1+k*x), for k=1..n, equals: (n!)^2*x + a(n); this sequence gives the constant term.
FORMULA
a(n) = Sum_{k=0..n-1} k!*(n-k)! * Sum_{i=0..n-k+1} (-1)^(n-i+1) * Stirling2(i,n-k+1) * Stirling1(n+1,i)).
EXAMPLE
Illustration of initial terms.
a(1) = 1, the constant term of (1+x);
a(2) = 5, the constant term of the sum of permutations of compositions of functions (1+x) and (1+2*x):
(1+x)o(1+2*x) + (1+2*x)o(1+x) = (2*x + 2) + (2*x + 3) = 4*x + 5.
a(3) = 40, the constant term of the sum of permutations of compositions of functions (1+x), (1+2*x), and (1+3*x):
(1+x)o(1+2*x)o(1+3*x) + (1+x)o(1+3*x)o(1+2*x) + (1+2*x)o(1+1*x)o(1+3*x) + (1+2*x)o(1+3*x)o(1+1*x) + (1+3*x)o(1+1*x)o(1+2*x) + (1+3*x)o(1+2*x)o(1+1*x) = (6*x + 4) + (6*x + 5) + (6*x + 5) + (6*x + 9) + (6*x + 7) + (6*x + 10) = 36*x + 40.
etc.
Alternatively,
a(2) = 5 = Sum_{i=1..2} (1+i),
a(3) = 40 = Sum_{i=1..3, j=1..3, j<>i} (1 + i*(1+j)),
a(4) = 524 = Sum_{i=1..4, j=1..4, k=1..4, k<>j<>i, k<>i} (1 + i*(1 + j*(1+k))), etc.
PROG
(PARI) {a(n) = sum(k=0, n-1, k!*(n-k)! * sum(i=0, n-k+1, (-1)^(n-i+1) * stirling(i, n-k+1, 2) * stirling(n+1, i, 1)))}
for(n=1, 20, print1(a(n), ", "))
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Oct 16 2016
STATUS
approved