Find $abcd \times 3 + 16 = dcba$

221 Views Asked by At

Find $abcd \times 3 + 16 = dcba$

I tried to solve it from "Find abcd x 4 = dcba"but I'm stucked at this point :

$d≥3$ because $dcba=3\times abcd ≥ 3\times1000=3000$

$abcd = \dfrac{dcba}{3} <9984 (10000-16)$ so $abcd < \dfrac{9984}{3}$

$1000<abcd<3328 \dfrac{9984}{3}$ because $a≠0$

Thanks in advance :)

3

There are 3 best solutions below

2
On

Assuming you allow matching digits the solution is $3 \cdot 1855+16=5581.$

As you observed we must have $d \ge 3$, but we must also have $a \le 3$ or there will be a carry out to the ten thousands. We can use the ones digit to write $3d+6=a$ (with some carry out). We can just try all the $a$s and ask what $d$ will satisfy it by looking at the ones column. $$\begin {array} {c c}a&d\\1&5\\2&2\\3&9 \end {array}$$ We see $a$ can only be $1$ or $3$ because $2$ makes $d$ too small. If $a=3$ we have no carry in when we consider the thousands place and a carry in of three from the ones to the tens. We can then write $3 \cdot bc +4=cb$ with $b \le 3$ to make there not be a carry out. Looking at the tens column we get $$\begin {array} {c c}b&c\\1&9\\2&6\\3&3 \end {array}$$ and none of these work. Similarly if $a=1, d=5$ we have a carry in of $2$ to the thousands place and a carry of $2$ into the tens, so we need $3\cdot bc+3=2cb$. We need $b \ge 6$ to get the carry out of $2$ and we try them. $$\begin {array} {c c}b&c\\6&1\\7&8\\8&5\\9&2 \end {array}$$ We see that $3\cdot 85+3=258$ as desired and $3\cdot 1855=5581$ is the desired solution assuming you do not prohibit two matching digits.

0
On

This may not be what you wanted, but it was fast and easy and it worked: I asked the computer to check every four-digit number.

    # Python 3
    def reverse(s):
        r = ""
        for i in range(0, len(s)):
            r += s[len(s) - i - 1]
        return r

    for i in range(10000):
        ii = "%04d" % i
        jj = "%04d" % (i*3+16)
        if ii == reverse(jj):
            print("%s %s" % (ii, jj))

This emitted the single solution, 1855 5581, in a small fraction of a second.

Being able to solve this sort of problem using mathematical technique is a valuable skill to have, but being able to solve this sort of problem by consulting a computer is also a valuable skill to have.

Sometimes most valuable is to have both skills and to know when to use each one.

0
On

The way I see it, there are three tools at our disposal:

1) $0 \le abcd, dcba < 10000$ and as $0 \le dcba = abcd\times 3 + 16 < 1000$ we can limit the possibl ranges.

2) $3d + 6 \equiv a \mod 10$

$3c + 1 + k \equiv b \mod 10$ (where $3d + 6 = a + 10k$)

$3b +j \equiv c \mod 10$ (where $3c + 1 + k = b + 10j$)

$3a + m =d$ (where $3b + j = c + 10m$).

So $3d + 6\le 33$ we know that the $k,j,m \le 3$.

This gives us distinct equivalence classes.

3) $abcd \equiv dcba \equiv a+b+c+d+e \mod 9$ so

$abcd \equiv 3\times abcd + 16 \mod 9$ so

$2abcd \equiv -16 \equiv 2\mod 9$ so $a+b+c+d \equiv 1 \mod 9$.


So let's put those together.

1) $0 \le 3\times abcd + 16 < 10000$

$-16 < 0 \le abcd < 9984$

$0 \le abcd < 3328$

So $a = 0,1,2,3$

If $a = 0$ then $0\le abcd < 1000$ and $16 \le dcba = 3*abcd + 16 < 3016$ so $d = 0,1,2,3$.

If $a = 1$ then $1000 \le abcd < 2000$ and $3016 < dcba = 3*abcd + 16 <6016$ and $d = 3,4,5,6$.

If $a = 2$ then $2000 \le abcd <3000$ and $6016\le dcba = 3*abcd + 16 < 9016$ and $d = 6,7,8,9$.

If $a =3$ then $3000 \le abcd < 3328$ and $9016 \le dcba = 3*abcd + 16 < 10000$. so $d = 9$

2) $3d + 6 \equiv 3d -4 \equiv a \mod 10$ and $3d \equiv a+4$.

$3*7\equiv 21 \mod 10 \equiv 1 \mod 10$

$3*7*d \equiv d \equiv 7a + 28\equiv 7a + 8 \mod 10$.

If $a = 0$ then $d= 8$. Impossible by 1)

If $a = 1$ then $d\equiv 15 \equiv 5 \mod 10$ and $d = 5$. Possible by 1)

If $a = 2$ then $d\equiv 22\equiv 2 \mod 10$ and $d =2$. Impossible by 1)

If $a = 3$ then $d\equiv 9\mod 10$ and $d = 9$. Possible by 1)

And we have $3a + m \equiv d \mod 10$.

If $a =1;d=5$ then $3 +m =5$ means $m =2$.

If $a =3; d=9$ then $3*3 + m = 9$ and $m =0$.

If $a =1; d=5; m=2$ then

$3d + 6 = a + 10k\implies 21 = 1 + 10k; k = 2$

$3c + 1 + k = 3c + 3= b + 10j$

$3b + j = c + 10m = c+20$

subtract those and you get:

$2c -17 = -2b + 9j$

$2c + 2b = 17 + 9j$

Now $0 \le 2a+2b \le 36$ and $17 \le 17+9j \le 44$.

The only even solution in range is $a+b = 13$ and $j = 1$

So $3c +3 = b+10$ and $3b + 1 = c+20$ and $b+c = 13$.

So $c = 5$ and $b = 8$.

And $abcd = 1855$ and $1855*3 + 16 = 5581 = dcba$.

And if $a = 3; d=9; m=0$ then

$3d + 6 = a +10k\implies 33 = 3 + 10k$ so $k = 3$.

$3c + 1 + k = 3c +4 = b + 10j$

$3b + j = c + 10m = c + 30$

subtract thos and you get

$2c - 26 = -2b + 9j$

$2c +2b = 9j + 26$

$26 \le 26 + 9j =2c+2b \le 34$ so $j \le 1$ and only solution is $j=0$ and

$c + b = 13$.

So $3c + 4 = b$ and $3b = c +30$ and $c+b = 13$

So $b = 10\frac 34 $ and $c = 2\frac 14$. Which is not acceptable.

So $abcd = 1855$

And we never used 3). But it's nice to know $abcd \equiv 1 \mod 9$ as we predicted.