Are there any prime numbers with more than two digits such that all combinations of its digits (preserving order) are prime? For example, if the number abc is prime, then a, b, and c are prime, and so are ab, ac, and bc.

What is the largest such number, or the largest known? I'm not even sure this is possible, but I imagine the probability of a prime passing this test gets really small really fast as you start adding digits...

  • 135
  • 5

2 Answers2


There is no such number. All digits except the first would have to be $3$, $7$ or $9$, since $1$ is not a prime and the remaining digits cannot be the last digits of primes with more than one digit. It cannot contain the same digit twice, since that would yield a number divisible by $11$. It also can't contain $39$ or $93$, which are divisible by $3$. That leaves only $37$, $73$, $97$ and $79$, preceded by one prime digit other than $3$ or $7$, i.e. $2$ or $5$. None of the eight resulting numbers is prime.

  • 215,929
  • 14
  • 263
  • 474

Largest is 73.

A related sequence is A051362, where all combinations of removing a single digit gives a prime number. That's a finite list, so it's a simple matter of looking there.

Ed Pegg
  • 19,476
  • 5
  • 37
  • 119
  • a) The question asked for numbers with more than two digits, so $73$ isn't one. b) The fact that that OEIS list is finite doesn't mean that there are finitely many such numbers. The entry itself says that the linked list of $200$ numbers only goes up to $10^{13}$. In response to [this question](http://math.stackexchange.com/questions/33094) I estimated that we should expect there to be about $2000$ such numbers, of which roughly half should be expected to have $74$ digits or more. – joriki Sep 14 '15 at 17:41