Le Monde puzzle (rainy Sunday!)

On October 14, the weekend edition of Le Monde had the following puzzle: consider four boxes that contain all integers between 1 and 9999, in such a way that for any N, N, 2N, 3N, and 4N are in four different boxes. If 1,2,3 and 4 are in boxes labelled 1,2,3 and 4, respectively, in which box is 972 located? The direct resolution of the puzzle is that, since N and 6N are always in the same box (proof below), 972=2²x3⁵ is the same box as 162 and 27. Filling the boxes by considering the multiples of 2,…,9 leads to 27 being in the second box. Here is however a brute force resolution in R, filling the boxes by looking at the three multiples of each value met so far.

boxin=function(N){ #gives the box N is in


nomul=function(N,j){ #check for no multiple in the same box

 if (j==1) nopb=((sum(N==2*box1)+sum(N==3*box1)+sum(N==4*box1))==0)&&
 if (j==2) nopb=((sum(N==2*box2)+sum(N==3*box2)+sum(N==4*box2))==0)&&
 if (j==3) nopb=((sum(N==2*box3)+sum(N==3*box3)+sum(N==4*box3))==0)&&
 if (j==4) nopb=((sum(N==2*box4)+sum(N==3*box4)+sum(N==4*box4))==0)&&


while (N<972){

  for (t in 2:4){

    if (sum(t*N==allbox)>0){
  if (sum(ndx==0)==1){ #no choice
    while (min(ndx)==0){

     if (okk) ndx=pro
  for (t in 2:4){

   if (ndx[t]==1) box1=unique(c(box1,t*N))
   if (ndx[t]==2) box2=unique(c(box2,t*N))
   if (ndx[t]==3) box3=unique(c(box3,t*N))
   if (ndx[t]==4) box4=unique(c(box4,t*N))

To prove that N and 6N are in the same box, consider that the numbers whose box is set are of the form 2i3j. Considering 2i3j.in box 1, say, and 2i+13j, 2i3j+1, and 2i+23j.in boxes 2, 3, and 4 respectively, 6×2i3j=2i+13j+1 cannot be in boxes 2 and 3. Furthermore, since 2i+23j=2×2i+13j, is in box 4, 2i+13j+1=3×2i+13j cannot be in box 4 either. Ergo, it is in box 1.

One Response to “Le Monde puzzle (rainy Sunday!)”

  1. Reading the solution in Le Monde today, numbers others than the powers of 2 and 3 can be arbitrarily allocated to one box, with the same reasoning for their multiples by powers of 2 and 3.
    There was also a subsidiary question about a similar scheme for nine boxes and a prohibition to see any pair out of N, 2N, …, 9N, within the same box but I find the resolution published in the next weekend edition rather unclear…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 919 other followers