prove; The sum of part of the numbers $1,2,...,n$, can be the average of the remaining numbers iff $n+1$ is a square.

66 Views Asked by At

I saw this question, and I proved the first half of the "iff", but I still need help to prove the second half.

Of the set $1,2,...,n$ you take the sum of part of the numbers, so that the sum will be the average of the remaining numbers in the set. You can take $2$ numbers or more. Prove that it's possible if and only if $n+1$ is a square.

Let's take the first $k$ numbers, so that their sum is; $1+2+...+k=\frac{k^2+k}{2}$, this sum should be the average of $\{k+1,k+2,...,n\}$, which is known to be the average of $\{k+1,n\}$. so; $$\frac{k+1+n}{2}=\frac{k^2+k}{2}\\k+1+n=k^2+k\\n+1=k^2$$ That proves the first half, that I can always find an solution if $n+1$ is a square, but I didn't find the way to prove the "only if" part. I guess we need to show that the previous example is the only one, but I haven't find such proof jet.

Thanks in advance for any help.

1

There are 1 best solutions below

5
On BEST ANSWER

Let's say for given $n$ there's a $k$ such that the task is possible. Denote the sum of the numbers you choose by $S_k$ then we have $$\frac{n^2+n}{2}-S_k=S_k(n-k)$$ Or $2S_k=\dfrac{n^2+n}{n-k+1}\ge k^2+k$, which is equivalent to $(n-k)(n+1-k^2)\ge 0$
Because $n-k>0$ so $n+1\ge k^2$, thus we can set $n+1=k^2+t\ (t\ge 0)$.
Since $n-k+1\mid n^2+n$ and $n-k+1\mid n^2-k^2+n+k$, which gives us $$k^2-k+t\mid k^2-k\Rightarrow k^2-k\ge k^2-k+t$$ So $t$ must be $0$, or $n+1=k^2$ and our proof is complete