The objective is $$\mathop {\min }\limits_{{n_c} \in N} \sum\limits_{c = 1}^C {n_c^2}\\ s.t.\sum\limits_{c = 1}^C {{n_c}} = n $$ where $N$ is non-negative integer.
I guess the optimal solution is $n_c=\frac{n}{C}$ for each $c$. However, it is possible $C$ is not divisible by $n$.
So, I have two problems:
- how to formally represent the optimal solution to this problem?
- how to prove the solution is optimal?
Your intuition is correct. For the continuous problem, you can invoke properties of convex minimization problems or just show directly that any other feasible solution can be improved. Suppose $n_i \not= n_j$ for some $i,j$. Then show that $$n_i^2+n_j^2 > \left(\frac{n_i+n_j}{2}\right)^2 + \left(\frac{n_i+n_j}{2}\right)^2.$$
A similar argument applies to the integer case, for which every optimal solution satisfies $n_c\in\{\lfloor n/C\rfloor,\lceil n/C\rceil\}$ for all $c$. To determine the number $L$ of values that should be at their lower bounds, solve $$L \lfloor n/C\rfloor + (C-L)\lceil n/C\rceil = n$$ for $L$.