Suppose (a1,a2,…,an) is an integer group which satisfies the conditions. Then by Cauchy's inequality we have
a12+⋯+an2≥n1(a1+⋯+an)2≥n3.1◯
Combining a12+⋯+an2≤n3+1, we see that it can only be a12+⋯+an2=n3 or a12+⋯+an2=n3+1.
If it is the former, then by the condition for Cauchy's inequality to take the equality sign, we can obtain a1=⋯=an. This requires a12=n2, 1≤i≤n. Combining a1+⋯+an≥n2, we have a1=⋯=an=n.
If it is the latter, then let bi=ai−n, then we have
b12+b22+⋯+bn2=i=1∑nai2−2ni=1∑nai+n3=2n3+1−2ni=1∑nai≤1.
Thus b12 can only be 0 or 1, and there is at the most one among b12, b22, ..., bn2 to be 1. If b12, ..., bn2 all are zero, then ai=n, ∑i=1nai2=n3=n3+1. It leads to a contradiction. If there is just one among b12, ..., bn2 to be 1, then ∑i=1nai2=n3±2n+1=n3+1. Again, it leads to a contradiction.
Consequently, we obtain that it can only be (a1,…,an)=(n,…,n).