How many 4-digit numbers can be crafted from $\{ 1,2,3,4,5 \}$ under the following conditions:
$1$ can not appear two or more times ($1142$) is not valid
$2$ can not appear three or more times ($2242$) is not valid
$3$ can not appear 4 times ($3333$) is not valid
With $4$ and $5$ there are no conditions. The thing is that a number can not appear more than its value say. That's why with $4$ and $5$ there are no conditions.
Obviously, 3204 is not valid.
After this condition, how could I compute the number of possible 4-digit numbers?