# Perfect Squares ending in 576

I want to find out perfect squares ending in 576, after the number 576.

Here is my derivation to arrive at such a number. Let the perfect square ending in $576$ be $1000k+576$. Every perfect square can be expressed as a the sum of a certain number of consecutive odd numbers. For eg: $2^2 = 1+3$, $3^2 = 1+3+5$, $4^2 = 1+3+5+7$, and so on..

Hence I can write my required perfect square ending in 576 as - $$(1+3+5+7+\cdots+49) + \underbrace{(51+53+55+57+\cdots)}_{(n\text{ summands})}$$

Therefore, $$(1+3+5+7+\cdots+49) + \underbrace{(51+53+55+57+\cdots)}_{ (n \text{ summands})} = 1000k +576.$$ Since $(1+3+5+7+ ....49) = 576$, the equation reduces to $$\underbrace{(51+53+55+57+\cdots)}_{n\text{ summands})} = 1000k$$

Using formula for Arithmetic Progression starting with 51 and a common difference of 2, \begin{align*} \frac{n}{2}\left(2(51) + (n-1)2\right) &= 1000k\\ n(n+50) &= 1000k \end{align*}

Put $n = 100$, $100\times 150 = 1000k$, hence $k = 15$.

Put $k = 15$ in the perfect square term $1000k+576$ we get the number $15576$.

But $15576$ is not a perfect square.

What is flawed in my derivation? Kindly help.

-
Why did you put $$n = 100$$ ? If you already know how many terms are in your sequence... – The Chaz 2.0 Jan 31 '12 at 16:20
n=100, is an assumption to find a starting value of n that satisfies the equation – The mach Jan 31 '12 at 16:31

The flaw is

Since, (1+3+5+7+ ....49) = 576

The sum is actually 625. You need to stop a term earlier.

-
Thanks a lot! I am very bad with calculation. – The mach Jan 31 '12 at 16:40

But I'd like to point out that what you are looking for are squares that are $576 \pmod{1000}$, i.e. solutions to $x^2 = 24^2 \pmod{1000}$.

This reduces to the equations \begin{align*} x^2 &= 24^2 \pmod{125} \\ x^2 &= 24^2 \pmod{8} \end{align*}.

The first solution can be solved to $x \equiv \pm 24 \pmod{125}$; the second implies $x\equiv 0\pmod 4$. We may then use the Chinese Remainder Theorem to reassemble these and we find that $x \mod 1000 \in \{24,476,524,976\}$ (This comes from: $x \mod 500 = \pm 24$.) Thus the squares ending in $576$ are exacly the squares of the numbers ending in 024, 476, 524 and 976. For instance $1024^2 = 1048576$.

-

If $x^2=24^2\pmod{1000}$, then $(x-24)(x+24)=0\pmod{1000}$. Thus, exactly one of $x-24$ or $x+24$ must be divisible by $125$ because their product is and if one is divisible by 5, the other is not. Furthermore, both $x-24=x+24=0\pmod{4}$ because they are equal $\!\!\pmod{4}$ and none of $1^2$, $2^2$, or $3^2$ are $0\pmod{8}$.

We need to solve one of \begin{align} x=24&\pmod{125}\\ x=0&\pmod{4} \end{align}\tag{1} or \begin{align} x=101&\pmod{125}\\ x=0&\pmod{4} \end{align}\tag{2} and these will give all the solutions $\pmod{500}$.

The solution to $(1)$ is $24\pmod{500}$ and the solution to $(2)$ is $476\pmod{500}$. Thus, numbers ending in $024$, $476$, $524$, and $976$ are the only ones whose squares end in $576$.

-

First of all, you cannot substitute $n=15$ because you don't know how many terms are there ($n$ is the indeterminant). What you will need is to solve the quadratic equation in terms of $n$.

Also, as others have mentioned you have to stop one term earlier. However, unfortunately the approach that you started will lead you to a circular argument and therefore to break out of that loop, you need to follow a different approach, one of them is mentioned by Myself. I will just try to work out a few steps to illustrate why you fall in a circular loop.

You start with $$n^2+48n =1000k.$$ Solving it for $n$ gives you $$n = \frac{-48 + \sqrt{48^2 + 4000k}}{2}$$ which should be an integer. Equivalently, you need, $$48^2 +4000k = 4p^2 \Rightarrow 24^2 + 1000k = p^2.$$

As you can see you end up from where you started. A quadratic equation in two unknowns. Modular arithmetic helps you out in these scenarios and give you an easy solution.

I hope it helps.

-
It doesn't have to be circular. $1000 | (n^2 + 48n)$, so substitute $n = 4m$ and get $125 | \left(m(m + 12)\right)$, whence either $125|m$ or $125|(m+12)$. That's enough to start generating much shorter lists of candidates. – Peter Taylor Jan 31 '12 at 17:10
I know, that's why I mentioned that modular arithmetic helps you out in these scenarios. – Jalaj Jan 31 '12 at 17:34