How can I prove that the numbers whose sum is $ 2n$ and sum of squares is $4n$ are unique? I know that sum$(a_i)$ = $2n$ and sum($a_i^2)$ = $4n$ and $a_i$ is any natural number > 0.
The sums are from 1 to n so they have exactly n terms.
I want to prove that any $a_i$ must be 2 in these conditions or that those $a_i$ are unique.

In other words: Let $n$ natural numbers $a_i > 0$, and assume the following summations are true:
$$
\sum_{i=1}^n a_i = a_1 + a_2 + a_3 + \cdots + a_n = 2n \\
\sum_{i=1}^n a_i^2 = a_1^2 + a_2^2 + a_3^2 + \cdots + a_n^2 = 4n
$$
Prove all $a_j = 2$. Or, prove that all $a_j$ are unique.
 A: The problem is:  given $a_1,a_2,\dots, a_n$ positive integers such that
$a_1+a_2+\dots + a_n=2n$ and $a_1^2+a_2^2+\dots + a_n^2=4n$, prove that $a_i=2$ for all $1\leq i \leq n$.
This can be solved in a more general setting with Jensen's theorem:
Suppose that $a_1+a_2+\dots + a_n$ are real numbers such that $a_1+a_2+\dots+a_n=A$. And let $f$ be a strictly convex function on $\mathbb R$.
We then have that $f(a_1)+f(a_2)+\dots + f(a_n)\geq nf(A/n)$ with equality if and only if $a_i=a/n$ for all $1\leq i \leq n$.

In our question we have the strictly convex function $f(x)=x^2$, we have that $A=2n$ and we have that $f(a_1)+f(a_2)+\dots + f(a_n)=nf(A/n)$. So we can conclude that $a_i=A/n=2$ for all $1\leq i \leq n$.
A: Hölder's Inequality says
$$
\left(\sum_{k=1}^na_k1_k\right)^2\le\sum_{k=1}^na_k^2\sum_{k=1}^n1_k^2\tag{1}
$$
with equality if and only if the vector $a_k$ is parallel to the vector $1_k$; that is, all the $a_k$ are the same.
Plugging the given information into $(1)$, we have
$$
(2n)^2\le4n\cdot n\tag{2}
$$
Since equality holds in $(2)$, all the $a_k$ must be the same, which means that $a_k=2$.
A: Assume $a_1=\cdots =a_k=1$ and $a_{k+1},\cdots, a_{n}\ge 2.$ We have that
$$2n=\sum_{i=1}^na_i=k+\sum_{i=k+1}^na_i\iff \sum_{i=k+1}^na_i=2n-k $$ and
$$4n=\sum_{i=1}^na_i^2=k+\sum_{i=k+1}^na_i^2\le k+ 2\sum_{i=k+1}^na_i=k+4n-2k=4n-k,$$ from where $k=0.$ That is, $a_i\ge 2$ for any $i.$
So, we have $$2n=\sum_{i=1}^na_i$$ and 
$$4n=\sum_{i=1}^na_i^2\le 2\sum_{i=k+1}^na_i= 4n.$$ Thus, the only possibility is $a_1=\cdots=a_n=2.$
