six digit puzzle using five restrictions

61 Views Asked by At

I have been stumped on this puzzle for a while now. I know the answer, but of course this does not satisfy my need to understand why.

Puzzle: Let $ABCDEF$ be a six digit number such that:

  1. All digits are different,

  2. The sum of the first two digits is the same as the sum of the last two digits, ($A+B = E+F$)

  3. The sum of all the digits equals the last two digits of the number, ($A+B+C+D+E+F = 10E+F$)

  4. The pairs $AB,CD$ and $EF$ are all prime, ($10A+B$, $10C+D$ and $10E+F$ all prime)

  5. The sum of the last two digits is less than $10$ ($E+F<10$ and hence $A+B<10$ using $2$)

What is the number?

My attempt:

Since $10A+B$ is prime, we have $B$ cannot be divisible by $2$ or $5$, in other words, $B$ must be $1,3,7$ or $9$. This logic is the same for $D$ and $F$.

Doing $3) - 2)$ yields:

$$C+D+E+F=9E$$ $$C+D+F=8E$$

Therefore $C+D+F$ is divisible be $8$. If that is true then $C+D+F$ is of course even. Since $F$ and $D$ has to be odd $(1,3,7,9)$, $C$ must be even.

That's essentially as far as got. I feel as though I am missing something simple.

Note: (the answer is: $416723$)

2

There are 2 best solutions below

1
On BEST ANSWER

I can't see anything better than casework. Conditions $2$ and $4$ tells us that $AB$ and $EF$ are two-digit primes with the same digit sum. This should greatly restrict the possibilities. (I'm assuming, as I think you did that we cannot have $E=0$.) A little python script produced

(4, [13, 31])
(5, [23, 41])
(7, [43, 61])
(8, [17, 53, 71])
(10, [19, 37, 73])
(11, [29, 47, 83])
(13, [67])
(14, [59])
(16, [79, 97])
(17, [89])

On each line, the first number is the digit sum, and the list gives all two-digit primes $>11$ with that digit sum. Of course, it would be easy to do this by hand.

The list is really shorter than it may appear. We are told that the sum of the digits in $EF$ is less than $10$, so we only have to consider the first $4$ lines. Also, we cannot have digit sum $4$, because it's not possible that one of $AB,EF$ is $13$ and the other is $31$. For the same reason, if the digit sum is $8$, then one of the primes must be $53$.

I haven't carried it any further than this.

EDIT

Of course, $C+D+F=8E\implies E\neq0$, so there's no need for assumptions.

3
On

There are only $20$ candidate primes out of which only $4$ pairs sum to less than $10$ and have distinct digits.

$$\{23,41\} , \quad \{17,53\} ,\quad \{53,71\}, \quad\{43,61\}$$

Now

$$1+2+3 \le C+D+F \le 7+8+9$$ $$\Rightarrow 6 \le 8E \le 24$$ $$\Rightarrow E \in \{1,2,3\}$$

From above we see that either $EF=17$, $AB=53$ $\Rightarrow CD=29$ due to

Since F and D has to be odd (1,3,7,9), C must be even.

which cannot satisfy the (third) sum condition or $EF=23$, $AB=41$.