[Math] Prove that for any integer $k>1$ and any positive integer $n$, there exist $n$ consecutive odd integers whose sum is $n^k$

number theoryproblem solving

Found these problems in a problem book and got stuck. The book doesn't have solutions to I've come here for help.

(1) Prove that for any integer $k>1$ and any positive integer $n$, there exist $n$ consecutive odd integers whose sum is $n^k$.

(2) Let $n$ be a positive integer and $m$ any integer of the same parity as $n$. Prove that there exist $n$ consecutive odd integers whose sum is $mn$.

Best Answer

$(1)$ $$\sum_{r=0}^{n-1}(2a+2r-1)=\frac n2\left[2a-1+2a+2(n-1)-1\right]=n(2a+n-2)$$

$$\implies 2a+n-2=n^{k-1}\iff 2(a-1)=n(n^{k-2}-1)$$ which is even for $k\ge2$ as then $n^{k-2}-1$ will be divisible by $n-1$

$(2)$ We need $n(2a+n-2)=mn\iff 2a+n-2=m\iff m-n=2a-2$ which is even $\implies m,n$ have same parity