I came up with an equation while solving a question. The question is - suppose we have n numbers, from 1 up to n. How many groups of 3 numbers (repetition allowed) can be formed whose sum will be n. 


The equation I came up with is something like this: 


$\sum\_{i=1}^{\left \lfloor \frac{n}{3} \right \rfloor} \left \lfloor \frac{n-i}{2} \right \rfloor-i+1$ 


This is giving correct result I hope. For example, for n=7, we can form 4 groups, (1,1,5), (1,2,4), (1,3,3), (2,2,3). My question is, how to get a more compact form of this equation? I am stuck since I don't find a way of finding the sum involving floor function.



How to find out the sum involving floor function
Your sum is related to [OEIS A001399 Number of partitions of n into at most 3 parts](http://oeis.org/A001399)  which is close to your formula `a(n)=sum{k=0..floor(n/3), floor((n-3k+2)/2)}`


This leads to [Number of partitions of n into 3 positive parts](http://oeis.org/A069905)


a(n)=Nearest integer to $\frac{n^2}{12}$


