# Is the number 100k+11 ever a square?

Is the number 100k+11 ever a square?

Obviously all such numbers end in 11. Can a square end with an 11?

• One question: do those "mods" appear like in EVERY problem in number theory?
Nov 26, 2013 at 9:47
• yes, i would even scratch out the "like" in that sentence, they appear in every problem! Nov 26, 2013 at 10:05
• I suppose I should familiarize myself with them. I also suppose that any textbook on number theory would do. But it is question when I will get to that.
Nov 26, 2013 at 10:16
• 13 IS a lucky number. it is not a square though.
Nov 26, 2013 at 16:03
• Mabe you would like to consider 0.05 instead.
Nov 26, 2013 at 16:11

Let $a^2=100\cdot k+11$. Then easily $a$ must be odd.
So $(2n+1)^2=100\cdot k+11$. It follows $2(n^2+n)=50\cdot k+5$, which is impossible.

• Very nice answer Mok-Kong Shen!
– P..
Nov 26, 2013 at 10:25
• Shouldn't that be $2n^2+n$? Nov 26, 2013 at 11:03
• Probably not. Which expression are you replacing?
Nov 26, 2013 at 11:52
• Sorry my mistake! Nov 26, 2013 at 14:43
• This means if the last two digits of any number is the format $4n+3$, it is not a square. Never realised. Nov 27, 2013 at 12:52

All numbers of this form are congruent $11 \pmod 4 \equiv 3 \pmod 4$. Now search one example of the very small list of residueclasses of that form which is also a square...

No. Only odd numbers ending with 01, 09, 21, 25, 29, 41, 49, 61, 69, 81, and 89 are squares. I will leave the proof to you.

• Fairly easy: $21^2=441$. For a computer proof, I suggest, in Python: sorted(set(n*n%100 for n in range(100) if n%2==1)), which will confirm David's list. Of course, it's not necessary to check beyond 100. Nov 26, 2013 at 10:03
• Interesting. After reading what egreg wrote I jumped to an erroneous conclusion that the last two digits of a number must be a square in order a number were a square.
Nov 26, 2013 at 10:23
• If anyone wants to take what @arbautjc said further, say to 10000000, though it's not necessary, you could do this at command-line: python -c "print sorted(set((str(n*n%100)[-2:].zfill(2)) for n in range(10000000) if n%2==1))" Nov 26, 2013 at 18:04
• "The proof is trivial, and is left as an exercise to the reader". The most dreaded sentence in my math textbooks.
– user42478
Nov 26, 2013 at 22:23
• Correction -- " ... and 89 are squares" should read " ... and 89 can be squares". Nov 26, 2013 at 23:24

Let's prove the somewhat more general result that $100k +\bar{ab}$ where $a$ and $b$ are odd digits cannot be a square. Our argument will be based on reductio ad absurdum:

$c^2=100k +10a+b$

$b$ is odd $\Rightarrow c \text{ is odd}$ $$\Rightarrow (2n+1)^2 = 100k+10(2l+1)+(2m+1)\\ \Rightarrow 2(n^2+n)=50k+5(2l+1)+m$$

The left hand side is even, therefor the right hand side should be even as well; this means that m should be odd.

$$\Rightarrow m=2j+1 \\ b<10\Rightarrow j=0\text{ OR }1\\ \Rightarrow n(n+1)=25k+5l+3+j$$

The left hand side can be $0,1,2$ modulo $5$; but the right hand side would be $3 \text { OR }4$ modulo $5$; which is a contradiction.

To make the last statement more clear; we elaborate as:

$$n(n+1)\mod5=\begin{cases} 0 & n\equiv0\text{ OR 4}\\ 1 & n\equiv2\\ 2 & n\equiv1\text{ OR 3} \end{cases}$$

Hint: Write $x=100y+z$; then $x^2=100(100y^2+2yz)+z^2$. Can you have $x^2=100k+11$? That is, $z^2\equiv 11\pmod{100}$.

A simple solution

$$(10x+y)^2 = 100x^2 + 20 xy + y^2$$

where $x$ is any number, and $0 \le y \le 9$

1. The first term on right hand side must end in two zeros.
2. The second term is a multiple of 20 and therefore must end in 00, 20, 40, 60, or 80
3. For the square to end in 1 $y$ must be either 1 or 9
4. In which case $y^2$ is either 01 or 81
5. Thus 4. and 2. imply that the square must end in either 01, 21, 41, 61, or 81

Here is a quick solution. Begin by making a list of all odd numbers 0-100.

>>> x = range(0, 50)
>>> list(x)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
>>> x = [2*k + 1 for k in x]
>>> x
[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99]


This is now done. Now square and mod by 100. We will also use set to weed out the pesky duplicates.

>>> x = [k*k%100 for k in x]
>>> x = set(x)
>>> x = list(x)
>>> x
[1, 69, 81, 9, 41, 29, 49, 21, 89, 25, 61]
>>>


Restore order for the sake of prettiness.

>>> x.sort()
>>> x
[1, 9, 21, 25, 29, 41, 49, 61, 69, 81, 89]
>>>


Now suppose you have any odd integer. You can write is as $100A + B$, $0 < B \le 99$, with $B$ odd. Squaring and modding you get that yields $(100A + B)^2 \% 100 = B^2 \% 100.$ You now have a complete list of the all possible last two digits of odd squares.

Ends by 11 means, $n² \mod 100 = 11$ which also implies end by one $n² \mod 10 = 1$

this is true if and only if $(n \mod 100)^2 \mod 100 = 11$ and $(n \mod 10)² \mod 10 = 1$.

Ergo you juste have to check squares of 1, 11, 21, 31, 41, 51, 61, 71, 81 and 91 and see none ends with 11.