OFFSET
1,2
FORMULA
a(n) = n!*n*(n^2+n+2)/4.
a(n) = n*A284816(n).
a(n) = n^2*A006595(n-1).
E.g.f.: x*(2 + x^2)/(2*(1 - x)^4). - Stefano Spezia, Feb 05 2024
EXAMPLE
For n=3 one of the colors c (3 choices) is used twice and one of the cells k (3 choices) gets two balls. If the cell k does not contain a c-colored ball, then all other cells do (1 variant). If the cell k contains a c-colored ball, after its removal there are 3!=6 variants for placing the remaining 3 different balls in the 3 cells. In total there are 3*3*(1+6)=63 variants.
MATHEMATICA
Table[n!n(n^2+n+2)/4, {n, 20}] (* James C. McMahon, Feb 02 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ivaylo Kortezov, Feb 02 2024
STATUS
approved