# Find the three digit Prime number P from the given unusual relationships

$$Given:$$

P is a 3 digit prime number

Q,R,S,T are distinct digits( 0 to 9 )

QRS is a concatenated number

$$Relationships:$$

$$P$$ = $$QRS + T$$ = Reverse of $$( QRS * T)$$

Find P using just deductive reasoning.

• I am looking at further simplifying the process of finding the numbers without the clue that it is prime. if you can look into it..wecan compareour thoughts tomorrow. – Uvc May 24 at 1:38

## Preliminary deductions

The starting equation is $$P=QRS+T=¬(QRS*T),$$ where I'm using ¬ (in lieu of any better notation I could think of) to denote reversal of a concatenated number. We know the following facts:

1. $$P$$ is prime and 3 digits. So the final digit of $$P$$ is one of $$1,3,7,9$$; and $$S,T$$ cannot be $$0$$.
2. $$Q*T$$ must be $$<10$$, and it equals $$S+T\:(mod10)$$ which equals the last digit of $$P$$.
3. $$Q$$ (or possibly $$Q+1$$ if $$R=9$$ and the sum $$S+T$$ carries) equals $$S*T\:(mod10)$$.

A further (interesting) deduction:

Since $$S+T$$ is odd, $$S$$ and $$T$$ must have different parities, so $$S*T$$ is even, which means the first digit of $$P$$ (almost certainly $$Q$$, bar any carrying) is even.

Let's eliminate one possibility before we continue,

namely $$Q=0$$. This can only happen if $$R=9$$ and the sum $$S+T$$ carries. In this case, $$P$$ is a prime just bigger than 100, namely one of $$101,103,107$$. So one of $$101,301,701$$ must have a factor just smaller than 100. But $$701$$ is prime and $$301=7*43$$, contradiction.

So none of $$Q,S,T$$ can be zero.

## Listing and eliminating possibilities

Now we can go through the different possibilities for $$T$$:

• If $$T=1$$, then we have $$QR(S+1)=SRQ$$ which is impossible.

• If $$T=3$$, then
(by considering $$S+T$$) $$S$$ must be one of $$8,0,4,6$$, so
(by considering $$S*T$$) $$Q$$ must be one of $$4,0,2,8$$, or possibly $$3$$ in the carrying case $$S=8$$.
But $$Q*T$$ does not carry, so we must have either $$Q=3$$ (then $$R=9,S=8$$, but $$398*3$$ is too big) or $$Q=2$$ (then $$S=4$$ and we have $$2R4+3$$ as the reverse of $$2R4*3$$; the only primes of the form $$2R7$$ are $$227,257,277$$, and none of these works).

• If $$T=4$$, then
(by considering $$S+T$$) $$S$$ must be one of $$7,9,3,5$$, so
(by considering $$S*T$$) $$Q$$ must be one of $$8,6,2,0$$, or possibly $$7,5$$ in the carrying cases.
But $$Q*T$$ does not carry, so we must have $$Q=2$$. Then $$S=3$$ and we have $$2R3+4$$ as the reverse of $$2R3*4$$; checking $$227,257,277$$ as before, none of them works.

• If $$T\geq5$$, then (by considering $$Q*T$$) $$Q$$ must be $$1$$. But we know $$S*T$$ is even, so $$R=9$$ and $$S*T$$ is $$2$$ (mod 10) and $$S+T$$ is one of $$11,13,17,19$$. So the only possibilities for $$\{S,T\}$$ are $$\{6,7\}$$ and $$\{8,9\}$$. That would give $$P=196+7,197+6,198+9,199+8$$, but none of these are prime, contradiction.

So we know

T=2. By considering $$S+T$$, we know $$S$$ must be one of $$9,1,5,7$$. By considering $$S*T$$, we know $$Q$$ must be one of $$8,2,0,4$$.
Clearly $$Q=8$$ is too big, and $$Q=0$$ doesn't work because no carrying. $$Q=2$$ would give $$P=2R1+2$$ as the reverse of $$2R1*2$$, which is impossible. $$Q=4$$ gives $$P=4R7+2$$ as the reverse of $$4R7*2$$. We then check the primes of the form $$4R9$$ to find

the final solution,

$$P=499=497+2=¬(497*2=994)$$, just as Ak19 already found by brute force.

• Although this logic is fully valid, I'm going to work on it some more because I've spotted some ways the reasoning could be shortened. But I'm going AFK now. – Rand al'Thor May 23 at 9:38
• @Rand..awesome..this is the kind of logical reasoning, I was looking for....yes..can be done in fewer steps – Uvc May 23 at 10:03
• @Uvc I shortened it quite a lot by squashing all the $T\geq5$ cases into one with some more general deductions. – Rand al'Thor May 23 at 10:47
• I think your final equation has the number on the right of the $=$ sign reversed...? – GentlePurpleRain May 23 at 14:36
• Thanks @gent; fixed. – Rand al'Thor May 23 at 14:38

TL;DR version:

$$QRS,T = 497,2$$ with $$497 + 2 = 499$$ = prime number and $$497 * 2 = 994$$ = reverse of prime number.
$$QRS,T = 026,5$$ with $$026 + 5 = 031$$ = prime number and $$026 * 5 = 130$$ = reverse of prime number. This answer only works if you let $$031$$ be a "three digit prime number". If it isn't, then disregard this answer.

My reasoning:

1) Since $$P$$ is prime, it must end in $$1, 3, 7, 9$$.

2) Since $$S + T = 1, 3, 7, 9$$ (modulo 10), one of them must be odd and the other even. If they were both odd or both even, they would add up to an even number.

3) Because $$S$$ and $$T$$ are one odd and the other even, when you multiply $$QRS$$ * $$T$$, the last digit is even. Since the last digit is the reverse of the prime, the first digit of the prime must be even. This is most likely $$Q$$ unless $$QRS$$ + $$T$$ carries the hundreds digit. So either $$Q$$ is even or $$R$$ is $$9$$ (or both).

4) If $$Q$$ is even, it will be $$2$$ or greater (I'll deal with $$Q = 0$$ as a special case later). This means that $$T$$ will be $$4$$ or smaller, otherwise $$QRS * T$$ will be four digits.

5) If $$T = 1$$ then: $$QRS + 1 = SRQ$$. Looking at the last digit, you get: $$S + 1 = Q$$ (modulo 10). But looking at the first digit, you get $$Q$$ = $$S$$ (the hundreds digit can't wrap because $$RS$$ can't be 99). It can't both be the case that $$S + 1 = Q$$ and $$S = Q$$, so $$T$$ can't be $$1$$.

6) If $$T = 3$$ then $$PRS$$ * $$T$$ would be divisible by 3 but so would its reverse (which is the prime). This is because numbers divisible by 3 have digits that add to a number divisible by 3. Thus, if a number is divisible by 3, then any permutation of that number's digits (including its reverse) will also be divisible by 3. Since 003 is the only prime divisible by 3, we can rule that out.

7) So if $$Q$$ is even, $$T$$ must be either $$2$$ or $$4$$. Let's first consider $$T = 2$$. Since $$S + T = 1, 3, 7, 9$$, the possible values of $$S$$ would be $$9, 1, 5, 7$$. Now consider each case, keeping in mind: $$QRS + T$$ = reverse of $$QRS * T$$ which means that $$Q = S * T$$ (modulo 10). (It could also be one less if $$R = 9$$).

8) Try $$S = 9, T = 2$$: $$S * T = 8$$ so $$Q = 8$$ (or $$7$$). But $$Q$$ is too large because $$700 * 2$$ is four digits.

9) Try $$S = 1, T = 2$$: $$S * T = 2$$, so $$Q = 2$$. But $$T = 2$$ already, so $$Q$$ can't be 2. ($$Q = 1$$ is also ruled out because $$S = 1$$).

10) Try $$S = 5, T = 2$$: $$S * T = 0$$, so $$Q = 0$$. So we need $$0R5 + 2 = 0R7$$ = prime and $$0R5 * 2$$ = reverse of prime = $$7R0$$. There is no $$R$$ that can make $$0R5 * 2$$ be as big as $$700$$.

11) Try $$S = 7, T = 2$$: $$S * T = 4$$ so $$Q = 4$$ ($$Q = 3$$ is ruled out because $$397 + 2$$ doesn't wrap to $$400$$ and neither is it a prime). So we need $$4R7 + 2$$ = $$4R9$$ = prime and $$4R7 * 2$$ = reverse of the prime = $$9R4$$. From this, $$R$$ must be 5 or greater to make $$4R7 * 2$$ be at least $$900$$. Checking each value from $$5$$ to $$9$$, only $$R = 9$$ works, giving the possible answer of $$497 + 2$$ = $$499$$ = prime and $$497 * 2 = 994$$. It turns out that $$499$$ is indeed a prime, so this is a valid answer.

Even though we have a valid answer, we can keep looking for more. We already tried $$T = 1,2,3$$, now try $$T = 4$$. This makes $$S = 7, 9, 3, 5$$

12) Try $$S = 7, T = 4$$: $$S * T = 8$$ so $$Q = 8$$ ($$Q = 7$$ is ruled out because $$S = 7$$). But $$8$$ is too big because $$800 * 4$$ is four digits.

13) Try $$S = 9, T = 4$$: $$S * T = 6$$ so $$Q = 6$$ (or $$5$$). But $$5$$ is too big because $$500 * 4$$ is four digits.

14) Try $$S = 3, T = 4$$: $$S * T = 2$$ so $$Q = 2$$ ($$Q$$ can't be $$1$$ because $$193 + 4 = 197$$ and doesn't wrap to $$200$$). So we need $$2R3 + 4 = 2R7$$ = prime and $$2R3 * 4 = 7R2$$. But $$200 * 4$$ is at least $$800$$ so it can't be $$7R2$$.

15) Try $$S = 5, T = 4$$: $$S * T = 0$$ so $$Q = 0$$. So we need $$0R5 + 4 = 0R9$$ = prime and $$0R5 * 4 = 9R0$$. But there is no way that $$0R5 * 4$$ will exceed $$900$$.

At this point, we've tried $$T$$ = $$1, 2, 3, 4$$. The only possibilities left are if $$T >= 5$$, which means that $$Q = 0, 1$$.

16) Consider $$Q = 1$$. It was shown earlier that the prime must start with an even number, so therefore $$Q$$ can only be $$1$$ if $$R = 9$$ and $$19S + T$$ exceeds $$200$$. But there are no primes in the range $$200$$ to $$209$$ so $$Q$$ can't be 1.

17) Now we are left with $$Q = 0$$ and $$T >= 5$$. Given that, we need $$0RS + T$$ = prime and $$0RS * T$$ = reverse of prime. Note that the prime can't be of the form $$10X$$ because from #3 above, the first digit of the prime must be even. So the prime must be of the form $$0XY$$. This means that $$S * T = 0$$ (modulo 10), which means either $$S = 5$$ or $$T = 5$$.

If $$S = 5$$, $$T$$ must be even, and since $$T >= 5$$, $$T$$ must be only $$6$$ or $$8$$. This means $$S + T = 1, 3$$. So $$0R5 * 6 = 1X0$$ or $$0R5 * 8 = 3X0$$. The only possible $$R$$ and $$X$$ to fit those equations are $$025 * 6 = 150$$ and $$045 * 8 = 340$$, but they don't work because $$025 + 6 \neq 051$$ and $$045 + 8 \neq 043$$. Therefore, $$S \neq 5$$.

If $$T = 5$$, $$S = 2, 4, 6, 8$$. Substituting each $$S$$, we get these four:

$$0R2 * 5 = 7XY$$
$$0R4 * 5 = 9XY$$
$$0R6 * 5 = 1XY$$
$$0R8 * 5 = 3XY$$.

The first two are impossible. The last two can work only with:
$$026 * 5 = 130$$ (valid answer: $$031 = 031$$)
$$036 * 5 = 180$$ (doesn't work because $$041 \neq 081$$)
$$068 * 5 = 340$$ (doesn't work because $$073 \neq 043$$)
$$078 * 5 = 390$$ (doesn't work because $$083 \neq 093$$)

So if a leading zero is possible, then $$QRS = 026$$ and $$T = 5$$ is a valid answer with $$QRS + T = 026 + 5 = 031$$ = prime number and $$QRS * T = 026 * 5 = 130$$ = reverse of prime number.

• It seems like we've used a lot of the same reasoning. But I'd excluded your second solution on the assumption that "3-digit prime" means the first digit of the three can't be zero. – Rand al'Thor May 23 at 11:20
• @Randal'Thor Yes I didn't notice that wording until later on, but I didn't want to edit out all my work in finding that answer. Having Q=0 ruled out would simplify several of my cases. – JS1 May 23 at 11:26

First off, we know that $$QRS +T$$ is still a 3 digit number because they are all single unique digits, and the highest value of $$QRS$$ is $$987$$ which would need $$T\ge13$$ in order to be a 4 digit number, which is not allowed.

Thus, we have:

 QRS        QRS
+  T  and  x  T
----       ----
ABC        CBA


Some initial observations:

1. $$S,T \in \{0,5\}$$ cannot be true since either would make $$A \in \{0,5\}$$ in the multiplication. $$A=0$$ means we have a 2 digit number as the sum, and $$A=5$$ is a repeated digit.
2. $$C \in \{0,2,4,5,6,8\}$$ would make $$ABC$$ non-prime, so those are invalid values for $$C$$.
3. If $$T=1$$, then $$CBA=QRS$$ and $$QRS+1=SRQ$$. In order for $$Q \ne S$$, $$R=S=9$$ to force two carry overs. This means we wouldn't have unique digits.
4. To satisfy the addition, we know that $$Q \le A \le Q+1$$ and $$R \le B \le R+1$$. i.e. $$A$$ and $$B$$ are either the same as or one more than $$Q$$ and $$R$$ respectively because carry overs can be at most 1.
5. $$C$$ must be at least as big as both $$T$$ and $$Q$$ because from multiplication, $$Q-- \times T = C--$$. $$C=T \implies S=0$$ from addition is invalid. Thus, $$C \ge Q$$ and $$C \ge T+1$$. Thus, $$T \ne 9$$.
6. The highest value for $$Q$$ is 4 since anything larger would result in 4 digits from the multiplication of $$T$$ and $$Q$$.

Thus we have the following restrictions: $$T \in \{2,3,4,6,7,8\}$$ $$C \in \{1,3,7,9\}$$ $$Q \in \{1,2,3,4\}$$ $$S \not \in \{0,5\}$$ $$Q \le A \le Q+1$$ $$R \le B \le R+1$$

Lets eliminate values of $$T$$.

If $$T=8$$ then $$C=9$$ and $$Q=1$$. By addition, this makes $$S=1$$ which is not unique.

If $$T=7$$, then $$C=9$$ and $$Q=1$$. From the addition, we get $$S=2$$. But the multiplication then requires $$A=4$$ which is too far from $$Q$$.

If $$T=6$$, then $$C \in \{7,9\}$$ and $$Q=1$$. $$C=7 \implies S=1$$ which is not unique. $$C=9 \implies S=3$$, but from multiplication, we then know $$A=8$$ which is too far from $$Q$$.

The final options require a bit more work.

## Assume $$T=4$$

$$C=9 \implies S=5$$ from simple addition, which we know is not a valid option for $$S$$.

Thus, $$C=7$$ and $$Q=1$$. From addition, we get $$S=3$$, which makes $$A=2$$ from multiplication. Thus, we need a 10s carryover on addition which we can't get since there is no 1s carry over.

## Assume $$T=3$$

Then $$Q \in \{1,2\}$$ and $$C \in \{7,9\}$$.

If $$Q=1$$ there is no way to get $$1XX \times 3 \ge 7YY$$, so neither option of $$C$$ is valid.

If $$Q=2$$, then

• $$C=9 \implies S=6$$ for addition and $$A=8$$ for multiplication. Too far from $$Q$$.
• $$C=7 \implies S=4$$ for addition and $$A=2$$ for multiplication. No carryover from addition means $$R=B$$. Multiplication has a 1s carryover and a 10s carryover so we get $$T \times R + 1 = R + 10 \implies R=4.5$$ which isn't a digit.

## Assume $$T=2$$

Then $$Q \in \{1,3,4\}$$.

If $$Q=1$$, then $$C = 3$$. But then $$S=1$$ to satisfy addition which is not unique.

If $$Q=3$$, then $$C = 7$$. To satisfy addition, this makes $$S=5$$ which is invalid.

If $$Q=4$$, then $$C = 9$$. To satisfy addition, $$S=7$$ which makes $$A=4$$ for multiplication. No ones carryover for addition means $$R=B$$. Multiplication has a 1s carryover, so we get $$T \times R + 1 = R + 10 \implies R=9$$. This gives the solution:

$$QRS=497$$ $$T=2$$

This is my take without using ..it is prime.

1)

$$Q<5$$...take $$4$$

2)

then $$T<3$$, ... take $$2$$

3)

$$T*S$$..$$Q$$..leads to $$S=7$$

4)

$$U=9$$

5) now...

$$4R9$$

6)

inspection with $$R=9$$..satisfies the equality..$$499$$