Pairs of perfect squares

contest-mathnumber theorysquare-numbers

Two perfect squares are said to be friendly if one is obtained from the other by adding
the digit 1 on the left. For example, $1225 = 35 ^ 2$ and $225 = 15 ^ 2$ are friendly. Prove that there are
in finite pairs of friendly and odd perfect squares.

Maybe Any product of square-full numbers is square-full.
$4n(n+1)+1=4n^{2}+4n+1=(2n+1)^{2}$

I don't know if that would help: http://oeis.org/A060355

Best Answer

Let $a^2$ and $b^2$, with $b^2 \gt a^2$, be the odd perfect squares which are also friendly. As Keith Backman's comment states, you get

$$b^2 - a^2 = (b+a)(b-a) = 10^{k} \tag{1}\label{eq1A}$$

As Mike Bennett's comment below suggests, another required condition is that $a^2$ be $k$ digits long, so $b^2$ is formed by adding a digit $1$ to the left of $a^2$ expressed in base $10$, i.e., it's also required that

$$10^{k} \gt a^2 \gt 10^{k-1} \tag{1B}\label{eq1B}$$

Note that, in \eqref{eq1A}, $b+a$ and $b-a$ must be both negative or both positive. Consider the case they are both positive. Since the only prime factors of $10^k$ are $2$ and $5$, plus that the sum & difference of $2$ odd numbers is always even, you have from \eqref{eq1A}

$$b + a = (2^c)(5^d), c \ge 1 \tag{2}\label{eq2A}$$

$$b - a = (2^e)(5^f), e \ge 1 \tag{3}\label{eq3A}$$

Also, since $10^k = (2^k)(5^k)$, you have

$$c + e = d + f = k \implies e = k - c, \; f = k - d \tag{4}\label{eq4A}$$

Adding \eqref{eq2A} to \eqref{eq3A} and dividing by $2$ gives

$$b = (2^{c-1})(5^d) + (2^{e-1})(5^f) \tag{5}\label{eq5A}$$

Subtracting \eqref{eq3A} from \eqref{eq2A} and dividing by $2$ gives

$$a = (2^{c-1})(5^d) - (2^{e-1})(5^f) \tag{6}\label{eq6A}$$

For $a$ and $b$ to both be odd requires that either $c = 1$ and $e = k - c = k - 1 \gt 1$, or $e = 1$ and $c = k - e = k - 1 \gt 1$. Thus, for every integer $k \ge 3$, you get the following $2$ possible sets of solutions:

$$b = 5^{d} + (2^{k-2})(5^{k-d}), a = 5^{d} - (2^{k-2})(5^{k-d}), 0 \le d \le k \tag{7}\label{eq7A}$$

$$b = (2^{k-2})(5^{d}) + 5^{k-d}, a = (2^{k-2})(5^{d}) - 5^{k-d}, 0 \le d \le k \tag{8}\label{eq8A}$$

However, the restriction in \eqref{eq1B} must also hold for any specific $d$ and $k$ to be valid values. In particular, for \eqref{eq7A} to be applicable, you require

$$\begin{equation}\begin{aligned} & 10^k \gt \left(5^{d} - (2^{k-2})(5^{k-d})\right)^2 \gt 10^{k-1} \\ & 10^k \gt 5^{2d} - (2^{k-1})(5^k) + (2^{2k-4})(5^{2k-2d}) \gt 10^{k-1} \\ & 10(10^{k-1}) \gt 5^{2d} - 5(10^{k-1}) + (2^{2k-4})(5^{2k-2d}) \gt 10^{k-1} \\ & 15(10^{k-1}) \gt 5^{2d} + (2^{2k-4})(5^{2k-2d}) \gt 6(10^{k-1}) \end{aligned}\end{equation}\tag{9}\label{eq9A}$$

For any larger $k$, having $2d \le k$ will not work since the second term in the middle, i.e., $(2^{2k-4})(5^{2k-2d})$, would be larger than the upper bound. Thus, have

$$2d = k + g, \; g \gt 0 \tag{10}\label{eq10A}$$

$$2k - 2d = 2k - (k + g) = k - g \tag{11}\label{eq11A}$$

You also have $2d \gt k - g$ and $k - 1 \ge k - g$. Divide all $3$ parts of the inequalities of \eqref{eq9A} by $5^{k - g}$ to get

$$\begin{equation}\begin{aligned} & 15(2^{k-1})(5^{g-1}) \gt 5^{2g} + 2^{2k-4} \gt 6(2^{k-1})(5^{g-1}) \\ & 15(2^{k-1})(5^{g-1}) \gt 25(5^{2(g-1)}) + 2^{2k-4} \gt 6(2^{k-1})(5^{g-1}) \end{aligned}\end{equation}\tag{12}\label{eq12A}$$

To make the algebra somewhat simpler, let $h = 5^{g-1}$ to see that \eqref{eq12A} is a set of $2$ quadratic inequalities, i.e.,

$$\begin{equation}\begin{aligned} 15(2^{k-1})h & \gt 25h^2 + 2^{2k-4} \\ 0 & \gt 25h^2 - 15(2^{k-1})h + 2^{2k-4} \\ 25h^2 - 15(2^{k-1})h + 2^{2k-4} & \lt 0 \end{aligned}\end{equation}\tag{13}\label{eq13A}$$

and

$$\begin{equation}\begin{aligned} 25h^2 + 2^{2k-4} & \gt 6(2^{k-1})h \\ 25h^2 - 6(2^{k-1})h + 2^{2k-4} & \gt 0 \end{aligned}\end{equation}\tag{14}\label{eq14A}$$

Using the quadratic formula, the roots of the LHS of \eqref{eq13A} are

$$\begin{equation}\begin{aligned} h & = \frac{15(2^{k-1}) \pm \sqrt{\left(15(2^{k-1})\right)^2 - 4(25)(2^{2k-4})}}{50} \\ & = \frac{15(2^{k-1}) \pm \sqrt{225(2^{2k-2}) - 25(2^{2k-2})}}{50} \\ & = \frac{15(2^{k-1}) \pm \sqrt{(25(2^{2k-2}))(9 - 1)}}{50} \\ & = \frac{15(2^{k-1}) \pm 5(2^{k-1})\sqrt{8}}{50} \\ & = \frac{(2^{k-1})(15 \pm 5(2)\sqrt{2})}{2(25)} \\ & = \frac{(2^{k-2})(15 \pm 10\sqrt{2})}{25} \end{aligned}\end{equation}\tag{15}\label{eq15A}$$

Similarly, using the quadratic formula gives that the roots of the LHS of \eqref{eq14A} are

$$\begin{equation}\begin{aligned} h & = \frac{6(2^{k-1}) \pm \sqrt{\left(6(2^{k-1})\right)^2 - 4(25)(2^{2k-4})}}{50} \\ & = \frac{6(2^{k-1}) \pm \sqrt{36(2^{2k-2}) - 25(2^{2k-2})}}{50} \\ & = \frac{(2^{k-1})(6 \pm \sqrt{11})}{2(25)} \\ & = \frac{(2^{k-2})(6 \pm \sqrt{11})}{25} \end{aligned}\end{equation}\tag{16}\label{eq16A}$$

The inequalities mean $h$ must be between the larger root in \eqref{eq16A} and the larger root in \eqref{eq15A}. Thus, you have the following inequalities, where I've multiplied by $25$ to clear the fractions and then taken the logarithms of the values, to the base of $5$, so can isolate $g$ appropriately, to get

$$\begin{equation}\begin{aligned} & \frac{(2^{k-2})(6 + \sqrt{11})}{25} \lt 5^{g-1} \lt \frac{(2^{k-2})(15 + 10\sqrt{2})}{25} \\ & (2^{k-2})(6 + \sqrt{11}) \lt 5^{g+1} \lt (2^{k-2})(15 + 10\sqrt{2}) \\ & (k-2)\log_{5}(2) + \log_{5}(6 + \sqrt{11}) \lt g + 1 \lt (k-2)\log_{5}(2) + \log_{5}(15 + 10\sqrt{2}) \end{aligned}\end{equation}\tag{17}\label{eq17A}$$

Note that

$$i = \log_{5}(6 + \sqrt{11}) \approx 1.3866955655 \tag{18}\label{eq18A}$$

$$j = \log_{5}(15 + 10\sqrt{2}) \approx 2.0952564 \tag{19}\label{eq19A}$$

Since $j - i \lt 1$, this means there's not even necessarily an integer value between the lower & upper bounds in \eqref{eq17A}. Also, from \eqref{eq10A}, $k$ and $g$ must have the same parity, so even if there's an integer in between, not all values of $k$ will work since some will give just one $g$ value with the wrong parity.

Note, though, as indicated from the question & answers in Multiples of an irrational number forming a dense subset, since $\log_{5}(2)$ is irrational, for any range $[p,q]$ for real $0 \le p \lt q \lt 2,$ there will be an infinite number of even positive integers $k$ for which $(k-2)\log_{5}(2)$ minus the largest even integer less than it will be in $[p,q]$. Thus, if you choose $p \gt 3 - j \approx 0.9047436$ (from \eqref{eq19A}) and $q \lt 3 - i \approx 1.6133044345$ (from \eqref{eq18A}), then there will be an odd integral integral value of $g+1$ which satisfies \eqref{eq17A}, so there will be an even value of $g$ which matches the parity of $k$. You can use basically the same process for odd $k$. This proves there are an infinite number of pairs of friendly, odd perfect squares. Note you can also use a similar procedure for \eqref{eq8A} to prove it also produces an infinite number of pairs of friendly, odd perfect squares.

One small issue is that, if you want to only use positive integers is the determined value of $a$ might be negative. However, since only its value squared is used, $-a$ (which is positive) is also a solution.

Note your specific example of $b = 35 = 25 + 10 = 5^2 + 2 \times 5$ and $a = 15 = 25 - 10 = 5^2 - 2 \times 5$ comes from \eqref{eq7A} with $k = 3, d = 2$. Also, in \eqref{eq17A}, you get $\approx 1.81737212357 \lt g + 1 \lt \; \approx 2.52593295807$, so $g + 1 = 2 \implies g = 1$, which with $k = 3$ in \eqref{eq10A} gives $2d = 3 + 1 \implies d = 2$. This shows the handling for the restriction of \eqref{eq1B} also gives the same result.

Related Question