## Smallest prime that does not divide any 5-digit number

Find the smallest prime that does not divide any 5-digit number whose digits are in a strictly increasing order.

Solution :

Let digit number   $n$   be a 5-digit number

$n \; = \; abcde$

with    $0 \; < \; a \; < \; b \; < c \; < \; d \; < \; e \; < \; 10$

Let   $S \; = \; (a+c+e) - (b+d)$

Then

$S \; = \; a + (c-b) + (e-d) \; > \; a \; > \; 0$

and

$S \; = \; e - (d-c) - (b-a) \; < e \; \leq \; 10$

so   $S$   is not divisible by 11 and hence   $n$   is not divisible by 11,

Thus 11 is the smallest prime that does not divide any 5-digit number whose digits are in a strictly increasing order.

math grad - Interest: Number theory
This entry was posted in Prime Numbers and tagged , . Bookmark the permalink.

### 2 Responses to Smallest prime that does not divide any 5-digit number

1. paul says:

I recon its 11, the next one after that is 97.

here is a bit of MMA code

c=1;n=1;
nums=FromDigits/@Cases[IntegerDigits/@Range[10000,99999],{a_,b_,c_,d_,e_}/;a<b<c<d<e];
While[c!=0,c=Count[Mod[nums,Prime[n]],0];n++];
Print[Prime[n-1]]


Paul.