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 A019581 #20 Jul 08 2025 07:32:28 %S A019581 0,2,18,180,2100,28800,458640,8361360,172141200,3954484800, %T A019581 100330876800,2786980996800,84133667217600,2742770705875200, %U A019581 96032990237184000,3594185336405664000,143193231131382432000,6050494745192177280000,270263142944131873536000 %N A019581 Place n distinguishable balls in n boxes (in n^n ways); let f(n,k) = number of ways that max in any box is k, for 1<=k<=n; sequence gives f(n,2). %H A019581 Alois P. Heinz, <a href="/A019581/b019581.txt">Table of n, a(n) for n = 1..200</a> %F A019581 a(n) = sum(d=1..floor(n/2), n!^2 / ( 2^d * (n-2*d)! * d! * d! ) ). %p A019581 b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0, %p A019581 add(b(n-j, i-1)/j!, j=0..min(2, n)))) %p A019581 end: %p A019581 a:= n-> n! *(b(n$2) -1): %p A019581 seq(a(n), n=1..30); # _Alois P. Heinz_, Jul 29 2014 %t A019581 a[n_] := n! (Hypergeometric2F1[1/2 - n/2, -n/2, 1, 2] - 1); Array[a, 30] (* _Jean-François Alcover_, Feb 18 2016 *) %o A019581 (PARI) a(n) = sum(d=1, n\2, n!^2 / (2^d * (n-2*d)! * d!^2)); \\ _Michel Marcus_, Aug 13 2013 %Y A019581 Cf. A019576. %Y A019581 Column k=2 of A019575. - _Alois P. Heinz_, Jul 29 2014 %K A019581 nonn,easy %O A019581 1,2 %A A019581 Lee Corbin (lcorbin(AT)tsoft.com), _N. J. A. Sloane_