OFFSET
8,1
COMMENTS
Also, a(n) is (i) the number of length-n words on the alphabet A, B, C, and D with each letter of the alphabet occurring at least twice; (ii) the number of ways to distribute n different toys to 4 children so that each child gets at least two toys; (iii) the number of ways to put n numbered balls into 4 labeled boxes so that each box gets at least two balls; (iv) the number of n-digit positive integers consisting of only digits 1,2,3, and 4 with each of these digits appearing at least twice.
A doubly-surjective function f:D->C is such that the pre-image set f^-1(y) has size at least 2 for each y in C.
LINKS
FORMULA
a(n) = 4^n-4*3^n-4*n*3^(n-1)+(9*n+3*n^2)*2^(n-1)+6*2^n-4-8*n-4*n^3;
a(n) = sum(n!/(i!j!k!m!) over <i,j,k,m> such that i,j,k, and m are all at least 2 and i+j+k+m=n.
E.g.f.: (exp(x)-x-1)^4.
a(n) = 24*A058844(n). - Alois P. Heinz, Apr 10 2013
G.f.: 24*x^8*(288*x^6-1560*x^5+3500*x^4-4130*x^3+2625*x^2-840*x+105) / ((x-1)^4*(2*x-1)^3*(3*x-1)^2*(4*x-1)). - Colin Barker, Jun 04 2013
EXAMPLE
a(9) = 30240 since there are 30240 ways to distribute 9 different toys to 4 children so that each child gets at least 2 toys. One child must get 3 toys and the other children get 2 toys each. There are 4 ways to pick the lucky kid. There are C(9,3) ways to choose the 3 toys for the lucky kid. There are 6!/(2!)^3 ways to distribute the remaining 6 toys among the 3 kids. We obtain 4*C(9,3)*6!/8=30240.
MAPLE
seq(eval(diff((exp(x)-x-1)^4, x$n), x=0), n=8..40);
MATHEMATICA
nn=27; Drop[Range[0, nn]! CoefficientList[Series[(Exp[x]-x-1)^4, {x, 0, nn}], x], 8] (* Geoffrey Critzer, Sep 28 2013 *)
PROG
(PARI) x='x+O('x^66); Vec(serlaplace((exp(x)-x-1)^4)) /* Joerg Arndt, Apr 10 2013 */
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Dennis P. Walsh, Apr 09 2013
STATUS
approved