Perfect square of summation of odd numbers

elementary-number-theorysquare-numbers

This is not homework , and I am old enough to be your father :-).We know the summation of odd numbers results in perfect squares , like $1 + 3 = 4 $, $1+ 3 + 5 = 9$ and so on.

My question is , if we start from a random odd number (say $315$) , how many odd numbers after $315$ results in a perfect square ? For what odd number $(2n-1)$ does :- $315 + 317 + 319 + …..(2n-1) = x^2 $ occur for $ n,x \in \mathbb{N} $ , and $(2n-1)> 315$ ?

Best Answer

We know that the sum up to $2k-1$ is $k^2$, so the sum up to $313$ is $157^2$. If the highest number in your sum is $2n-1$ we then are asking that $$n^2-157^2=x^2\\(n+x)(n-x)=157^2$$ There will be a solution for each way of factoring $157^2$ into two numbers of the same parity, so both must be odd. As $157$ is prime, the only factorization of interest is $1,157^2$ $$n+x=157^2\\n-x=1\\n=\frac 12(1+157^2)=12325\\x=12324$$