0
$\begingroup$

I came across a question today.

The number of 10-digit numbers such that the product of any two consecutive digits in the number is a prime number, is?

As much as I know the product of any two consecutive digits is a prime number only when one of them is $1$ and the other is a prime number (unless I am missing something). But I still can't see any way forward. So, how to do this?

EDIT: The answer to this problem is

2048

$\endgroup$
  • 1
    $\begingroup$ I think you're off to a good start. So basically, every other number has to be 1. The other digits have to be 2,3,5, or 7. Consider numbers of the form 1x1x1x1x1x, where x = 2,3,5, or 7. Then, consider numbers of the form x1x1x1x1x1. EDIT: I just realized that 1 is not a prime number, so the "x" here cannot be 1. $\endgroup$ – nukeguy Feb 29 '16 at 20:04
  • $\begingroup$ Is this good enough? 2121212121 $\endgroup$ – Moti Feb 29 '16 at 20:11
1
$\begingroup$

The answer is: x1x1x1x1x1, where x can be any of: 2,3, 5, 7

$\endgroup$
  • $\begingroup$ And the same with the x's and $1$s reversed. $\endgroup$ – joriki Feb 29 '16 at 20:16
  • $\begingroup$ the question is asking for the number of 10 digit numbers $\endgroup$ – manshu Feb 29 '16 at 20:17
  • $\begingroup$ Thought this would help you, but it did not! So here it is: $2^{11}$ $\endgroup$ – Moti Feb 29 '16 at 20:21
  • $\begingroup$ but why is it $2^{11}$ $\endgroup$ – manshu Feb 29 '16 at 20:22
  • 1
    $\begingroup$ For each x you have 4 possible selections (2, 3, 5, 7) - you multiply 4, 5 times ( for the 5 slots) - $4^5=2^{10}$. And than by 2 - see jorki comment. $\endgroup$ – Moti Feb 29 '16 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.