This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A224542 #27 Feb 22 2025 21:30:19 %S A224542 2520,30240,226800,1367520,7271880,35692800,165957792,742822080, %T A224542 3234711480,13803744864,58021888080,241116750624,993313349544, %U A224542 4064913201216,16549636147968,67112688842496,271323921459096,1094303232174240,4405390451382960,17709538489849440 %N A224542 Number of doubly-surjective functions f:[n]->[4]. %C A224542 Fourth column of A200091: A200091(n,4)=a(n). %C A224542 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. %C A224542 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. %C A224542 Triangle A200091 provides the number of doubly-surjective functions f from a set of size n onto a set of size k. Hence a(n) is column 4 of A200091. %H A224542 Dennis Walsh, <a href="http://capone.mtsu.edu/dwalsh/DOUBSURJ.pdf">Notes on doubly-surjective finite functions</a> %F A224542 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; %F A224542 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. %F A224542 E.g.f.: (exp(x)-x-1)^4. %F A224542 a(n) = 24*A058844(n). - _Alois P. Heinz_, Apr 10 2013 %F A224542 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 %e A224542 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. %p A224542 seq(eval(diff((exp(x)-x-1)^4,x$n),x=0),n=8..40); %t A224542 nn=27; Drop[Range[0,nn]! CoefficientList[Series[(Exp[x]-x-1)^4, {x,0,nn}], x], 8] (* _Geoffrey Critzer_, Sep 28 2013 *) %o A224542 (PARI) my(x='x+O('x^66)); Vec(serlaplace((exp(x)-x-1)^4)) /* _Joerg Arndt_, Apr 10 2013 */ %Y A224542 Cf. A224541, A052515. %K A224542 nonn,easy %O A224542 8,1 %A A224542 _Dennis P. Walsh_, Apr 09 2013