Differences between numbers of the form abcdef and acdef which are perfect square.

111 Views Asked by At

$541456-51456=700^2$ is the example I found. Are there other examples of numbers of the form abcdef such that abcdef-acdef is a perfect square?

2

There are 2 best solutions below

0
On

$$abcdef-acdef=10^4b+10^5a-(10^4a)=10^4(9a+b)$$

So, all we need is $9a+b$ to be perfect square

0
On

Of course, $$ \begin{aligned} \overline{abcdef} - \overline{acdef} &= \overline{ab0000} - \overline{a0000} \\ &=10000\cdot(\overline{ab} - \overline{a}) \\ &=100^2\cdot(9a+b)\ . \end{aligned} $$ So we can choose $c,d,e,f$ arbitrarily, and for $a,b$ there are the following chances:

for a in [1..9]:
    for b in [0..9]:
        ab_a = 9*a + b
        if ab_a.is_square():
            print ( "a=%s b=%s %s-%s = %s^2"
                    % (a, b, 10*a+b, a, sqrt(ab_a)) )

And the results are:

a=1 b=0 10-1 = 3^2
a=1 b=7 17-1 = 4^2
a=2 b=7 27-2 = 5^2
a=3 b=9 39-3 = 6^2
a=4 b=0 40-4 = 6^2
a=5 b=4 54-5 = 7^2
a=7 b=1 71-7 = 8^2
a=8 b=9 89-8 = 9^2
a=9 b=0 90-9 = 9^2

Here i was using sage.