You don't want the complete solution, so I won't give it to you; I'll just try to point you in the right direction.
First of all, you need to decompose the problem in simpler ones. In your case, this do the trick:
|(x_1,...x6) : sum(x_i) < M | = sum( |(x_1,...,x6) : sum(x_i) = N|)
for N=6,...,M-1
. Now, you only need different solutions, so you can assume that:
x_1 <= x_2 <= ... <= x_6
Now, counting the number of ways you can get k
elements to sum up to N
isn't that hard ( try first with 2 elements, than 3, and try to get the general forumla and, if you have some time on your hands, prove it by induction ), and once you have that you are basically done.
IMPORTANT NOTE : as it should be clear by now, I think that the combinotorics approach is way better than the brute force one