# What is the next perfect square of the form 14444… in decimal notation?

We know that $12^2 = 144$ and that $38^2 = 1444$. Are there any other perfect squares in the form of $\frac{13}{9} (10^n - 1) + 1$ (i.e. $1$ followed by $n$ $4$'s), and how would we prove it?

• Seems you forgot to add $1$? – MonkeyKing Apr 12 '15 at 6:33
• Oh, yes, I suppose I did. – Joe Z. Apr 12 '15 at 6:35
• $$(10m\pm2)^2=100m^2\pm40m+4$$ We need $100m^2\pm40m+4=\dfrac{13(10^n-1)}9+1$ $$900m^2\pm360m+40=10^n$$ $$90m^2\pm36m+4=13\cdot10^{n-1}$$ – lab bhattacharjee Apr 12 '15 at 6:49
• I would first ask whether it is possible for a square to end in 4444. If the answer is no, then you win. – Gerry Myerson Apr 12 '15 at 7:07
• @GerryMyerson: One can easily check by brute force that 4444 is not a perfect square mod 10000, so no perfect square can end in 4444. The answer described by user128776 is much more elegant, though. – Nate Eldredge Apr 12 '15 at 19:03

## 2 Answers

144...4 is divisible by 4 hence it follows that 144...4 is a perfect square when 3611...1 is also a perfect square.

36 and 361 are special cases because others can be written by following

3611....111 = 4(25$m$ + 2) + 3 where $m$ is in $Z$

Consider the proof in the following question:

Proving that none of these elements 11, 111, 1111, 11111...can be a perfect square

Therefore, 3611...1 can not be a perfect square.

• Essentially, a square can't end in 11. – Gerry Myerson Apr 12 '15 at 7:09

Brute force answer:

If $x^2 = 1\cdots4444$ then we can consider this mod $10000$ to see that we must have $x^2 \equiv 4444 \pmod{10000}$. To see if such $x$ exists, it is sufficient to consider $0 \le x < 10000$. The following C program terminates with no output, showing that no such $x$ exists.

#include <stdio.h>

int main(void) {
int x;
for (x = 0; x < 10000; x++) {
if ((x * x) % 10000 == 4444) {
printf("%d\n", x);
}
}
return 0;
}


Note that you should run this on a system where int is at least 32 bits.

• Is there a solution for $x^2=444\pmod{1000}$ that you chose $10000$? – Asaf Karagila Apr 12 '15 at 22:15
• @AsafKaragila: As mentioned in the question, $38^2=1444$. – Nate Eldredge Apr 12 '15 at 23:46
• Shows you that my ability to read a question is so inconsistent, it could essentially prove and disprove the Riemann Hypothesis. – Asaf Karagila Apr 12 '15 at 23:48
• "it is sufficient to consider" $\: 0\leq x\leq 5000 \:$, $\:$ since $\: x\mapsto x^2 \:$ is an even function. $\hspace{1.5 in}$ – user57159 Apr 13 '15 at 0:02