The sum of four whole numbers is six. In how many ways can this be done, if none of the numbers is greater than three? Note that the order of the numbers does NOT matter. For example, (0,2,2,2), (2,0,2,2), (2,2,0,2), and (2,2,2,0) will be taken as just one combination.
The correct answer is five. Of course, this can easily be found by 'trying' different values but I am looking for a more mathematical approach, so that I may apply the same logic for bigger numbers.

Idk how you say the correct answer is $5$. I get $9$ which can easily be 
enumerated.
$6-0-0-0$ [part$(6,1)$]
$5-1-0-0,\; 4-2-0-0,\; 3-3-0-0$ [part$(6,2)$] 
$4-1-1-0,\; 3-2-1-0,\; 2-2-2-0$ [part$(6,3)$]
$3-1-1-1,\; 2-2-1-1$ [part$(6,4)$]
As already commented, this deals with partitions, distributing indistinguishable objects to indistinguishable boxes, about which you can read more here and find recursion formulas.
