Here's another way that seems a little slicker for the example, though I don't know which method scales up better.
Create a 4th bin for the balls you don't use. There are $4^5$ ways of putting the 5 balls into the 4 bins. Now use inclusion-exclusion; subtract the ones where one of the three bins is empty, add back in the ones where two bins are empty, subtract the ones where all three bins are empty. I get $$4^5-3\times 3^5+3\times2^5-1^5$$
EDIT: To relate this to well-studied concepts, the number of ways to put $n$ distinguishable balls into $m$ distinguishable bins, if you have to use all the balls and leave no bin empty, is $m!S(n,m)$, where $S(n,m)$ are the Stirling numbers of the second kind, q.v.
Now if you don't use all the balls, that's the same as putting the unused balls into an extra bin. So the answer to your problem is $$m!S(n,m)+(m+1)!S(n,m+1)$$
There is much information on Stirling numbers in books and online.
The stated answer is too large. We can partition the number $6$ into at most four parts in the following ways:
\begin{align*}
6 & = 6\\
& = 5 + 1\\
& = 4 + 2\\
& = 4 + 1 + 1\\
& = 3 + 3\\
& = 3 + 2 + 1\\
& = 3 + 1 + 1 + 1\\
& = 2 + 2 + 2\\
& = 2 + 2 + 1 + 1
\end{align*}
These partitions correspond to the following distributions.
$6$: All six balls can be placed in one bin in one way.
$5 + 1$: Five balls can be placed in one bin and one ball can be placed in a different bin in six ways, depending on which ball is placed in a separate bin.
$4 + 2$: Four balls can be placed in one bin and two bins can be placed in a different bin in $\binom{6}{4} = 15$ ways, depending on which four balls are placed together.
$4 + 1 + 1$: Four balls can be placed in one bin and the other two balls can be placed in separate bins in $\binom{6}{4} = 15$ ways, again depending on which four balls are placed together.
$3 + 3$: Suppose the balls are six different colors, including blue. There are $\binom{5}{2} = 10$ ways to choose which two balls are placed in the same bin as the blue ball. The other three balls must be placed in another bin.
$3 + 2 + 1$: There are $\binom{6}{3}\binom{3}{2}\binom{1}{1} = 60$ ways to distribute the balls to three bins so that one bin receives three balls, another bin receives two balls, and the third bin receives one.
$3 + 1 + 1 + 1$: There are $\binom{6}{3} = 20$ ways to distribute the balls to four bins so that one bin receives three balls and each of the other bins receives one ball, depending on which three balls are placed together.
$2 + 2 + 2$: Suppose the balls are different colors. If we list the balls in alphabetical order, there are five ways to choose which ball is placed in the same bin as the first ball on the list. That leaves four balls. There are three ways to pick the color of the ball that is placed in the same bin as the first ball remaining on the list. The third bin must hold the remaining two balls. Hence, there are $\binom{5}{1}\binom{3}{1} = 15$ ways to distribute the balls so that two balls each are placed in three of the indistinguishable bins.
$2 + 2 + 1 + 1$: There are $\binom{6}{2}$ ways to choose which two balls will be placed in a bin by themselves. That leaves four balls to distribute to the remaining two bins in such a way that each such bin receives two balls. If we list the remaining balls alphabetically, the color of the ball that is placed in the same bin as the ball with the first color on that list can be chosen in three ways. Hence, there are $\binom{6}{2}\binom{3}{1} = 45$ ways to distribute the balls so that two bins each receive two balls and two other bins each receive one ball.
That gives a total of $1 + 6 + 15 + 15 + 10 + 60 + 20 + 45 = 187$ ways to distribute six distinct balls to four indistinguishable bins.
In terms of Stirling numbers of the second kind, the above calculations show
\begin{align*}
S(6, 1) & = 1\\
S(6, 2) & = 6 + 15 + 10 = 31\\
S(6, 3) & = 15 + 60 + 15 = 90\\
S(6, 4) & = 20 + 45 = 65
\end{align*}
Note that $S(6, 1)$ corresponds to the $6$ balls in one bin case; $S(6, 2)$ corresponds to the distributions $5 + 1$, $4 + 2$, and $3 + 3$; $S(6, 3)$ corresponds to the distributions $4 + 1 + 1$, $3 + 2 + 1$, $2 + 2 + 2$; $S(6, 4)$ corresponds to the distributions $3 + 1 + 1 + 1$, $2 + 2 + 1 + 1$.
In total, there are
$$S(6, 1) + S(6, 2) + S(6, 3) + S(6, 4) = 1 + 31 + 90 + 65 = 187$$
ways to distribute six distinct balls to four indistinguishable bins.
Best Answer
I don't think it is easy to go from (a) to (b) or vice versa (unless the numbers are very small).
Part (b) is much easier. It is solved by stars and bars and has a closed-form solution (in fact, a binomial coefficient).
For part (a), we're talking about integer partitions but with the additional restriction that the number of parts $\le 4$. The wiki article includes the restricted case where the number of parts is exactly $k$, so I suppose you can sum over $k \in [1, 4]$. Anyway, I don't think there is a general solution. Here is a related MSE thread which limits both the number of parts to $\le k$ and the size of each part to $\le d$. So if we set $d=c$ so that each part is unlimited but the number of parts is still limited to $\le k$ then this becomes the OP question.