1

Two perfect squares are friends if one is obtained from the other adding the digit $1$ at the left.

For instance, $1225 = 35^2$ and $225 = 15^2$ are friends.

Prove that there are infinite pairs of odd perfect squares that are friends.

Solution: Suppose that $n^2$ and $m^2$ are friends and both odd, with the former being greater than the latter. Then $n$ and $m$ are both odd, and $n^2 - m^2$ is a power of ten.

Then, because of the difference-of-squares identity $n^2 - m^2 = (n-m)(n+m)$, this means that $n+m = 2^a 5^b$ for some $a, b$ and $n-m = 2^c 5^d$ for some $c, d$, where $a + c = b + d$.

Adding the two equations, we obtain $2n = 2^a 5^b + 2^c 5^d$. The right hand side has to be even, but not a multiple of 4. This means that $a$ and $c$ have to be both positive or zero. If they are both positive, they cannot be both at least two (since the right hand side would be a multiple of 4), but they cannot be both one (since $2^a 5^b + 2^c 5^d = 2(5^b + 5^d)$ would be a multiple of 4), so one of them has to be one and the other has to be at least two. If $a$ and $c$ are both zero, then $2^a 5^b + 2^c 5^d = 5^b + 5^d \equiv 1^b + 1^d \equiv 2\pmod{4}$, so all such cases work.

Similarly, subtracting the two equations, we obtain $2m = 2^a 5^b - 2^c 5^d$. The right hand side has to be even, but not a multiple of 4. This means that $a$ and $c$ have to be both positive or both zero. If they are both positive, they cannot be both at least two, and they cannot be both one, so one of them has to be one and the other has to be at least two. However, if $a$ and $c$ are both zero, then $2^a 5^b - 2^c 5^d = 5^b - 5^d \equiv 1^b - 1^d \equiv 0\pmod{4}$, so no such cases work.

In conclusion, we have demonstrated that $n^2$ and $m^2$ are friends and both odd iff $n+m = 2^a 5^b$ for some $a, b$ and $n-m = 2^c 5^d$ for some $c, d$, where $a + c = b + d$ and where $a = 1, c \geq 2$ or vice versa. This clearly covers infinitely many cases, so we are done.

Why is $ n ^ 2 - m ^ 2 $ a power of ten?

Shaun
  • 44,997
trombho
  • 1,591
  • Do you want to classify those numbers or just additional examples ? – Peter Nov 20 '19 at 20:41
  • @Peter I was wondering why $ n ^ 2-m ^ 2 $ is necessarily multiples of 10. – trombho Nov 20 '19 at 20:42
  • @Peter Can you do both? – trombho Nov 20 '19 at 20:51
  • @S.Dolan Note this is basically the same as OP's question of just over a month ago of Pairs of perfect squares, except it asks here about why $n^2-m^2$ is a power of ten. As my updated answer there showed, the solution is not quite so simple since $n^2 - m^2 = 10^{k}$ must also be an appropriate power of $10$, i.e., with $10^{k} \gt m^2 \gt 10^{k-1}$. The solution above does not enforce this, so it's incomplete. Although to show it holds for infinitely many cases can be done, it's not particularly simple. – John Omielan Nov 20 '19 at 22:03

2 Answers2

5

Why is $ n ^ 2 - m ^ 2 $ a power of ten?

Because they are friends: the power of ten is the digit $1$ on the left, followed by as many zeros as there are digits in the smallest of the numbers.

In more detail, if $n^2=\overline{n_1\cdots n_r}$ and $m^2=\overline{m_1\cdots m_s}$ are friends and $n>m$, where the bar represents the decimal expansion of the number at hand, then $r=s+1$, $n_1=1$, and $m_i=n_{i+1}$ for all $i\in\{1, \dots , s\}$. Hence

$$\begin{align} n^2-m^2&=\overline{1m_1\cdots m_{s}}-\overline{m_1\cdots m_s}\\ &=\overline{1\underbrace{0\cdots 0}_{s\text{ times}}}\\ &=10^s. \end{align}$$

Shaun
  • 44,997
  • I did not understand very well ... – trombho Nov 20 '19 at 20:51
  • Can you prove it to me? – trombho Nov 20 '19 at 20:52
  • 4
    @EsposaDoYoongi "By adding digit $1$ to the left"... So, you have one of the numbers is $1\overline{abc\cdots n}$ and the other of the numbers is just $\overline{abc\cdots n}$ (where the overbar just indicates that these variables are concatenated rather than multiplied), such as in your example $1225$ and $225$. You are asking why $1225-225 = 1000$ is a power of $10$? Or otherwise why $1\overline{abc\cdots n} - \overline{abc\cdots n} = 1\overline{000\cdots 0}$ is a power of ten? It seems rather obvious, but if you want a formal proof look at the definition of decimal representations. – JMoravitz Nov 20 '19 at 21:00
  • @EsposaDoYoongi, I have edited the answer now. Is that more clear than it was? – Shaun Nov 20 '19 at 21:06
  • You beat me to it, @JMoravitz! – Shaun Nov 20 '19 at 21:11
  • 1
    @Shaun Thanks! :) – trombho Nov 20 '19 at 22:03
  • You're welcome, @EsposaDoYoongi. – Shaun Nov 21 '19 at 01:58
2

You may be interested in a relatively simple method of generating an infinite sequence of such numbers.

First we shall prove that if $A$ and $B$ are powers of $5$ and $C$ a power of $2$ such that

$\,\,\,\,\,\,2A^2BC$ is a power of $10$ and $1\le\frac{C}{B}\le \frac{5}{2},$

then a solution is given by $n=A(5B+C)$ and $m=A(5B-C)$.

$n^2-m^2=20A^2BC$ is a power of $10$ and so we require $$20A^2BC>A^2(5B-C)^2\ge 2A^2BC.$$ This gives two inequalities which are both satisfied when $\frac{C}{B}$ is in the above range $$C^2-12BC+25B^2\ge 0 \text { and } C^2-30BC+25B^2<0. $$

$A=5,B=1,C=2$ is an example of numbers satisfying the condition given above. From any such solution we can generate a larger solution as follows.

If $\frac{C}{B}< \frac{25}{16}$ then $(A',B',C')=(5A,5B,8C)$

If $\frac{C}{B}\ge \frac{25}{16}$ then $(A',B',C')=(5A,25B,16C)$

The first few solutions generated from $(5,1,2)$ are as follows.

$n^2=1225$ and $m^2=225$

$n^2=15405625$ and $m^2=5405625$

$n^2=12127515625$ and $m^2=2127515625.$

  • +1 - This is a lovely, interesting answer. As I'm sure you realize, your range of $1 \le \frac{C}{B} \le \frac{5}{2}$ is more restrictive that it needs to be, but it suffices for your proof. – John Omielan Nov 21 '19 at 06:08
  • Yes - I just tried to find a 'neat' one –  Nov 21 '19 at 08:54