"A chess problem," said the great mathematician JE Littlewood, "is an exercise in pure mathematics." An odd thing for him to have bothered to say, but you can see what he meant. The specification "White to play and mate in n" is an invitation to work through all legal sequences of n moves to determine which opening move guarantees a solution to the problem - a simple, finite task.

In practice, of course, we don't solve problems that way, but use our chess experience to provide a short cut to the solution. Today's position, however, is one where pure logic is the best remedy. Composed by Werner Speckmann, it is White to play and mate in five.

The key piece is clearly the white bishop on the long diagonal. If he can only find a safe square for it, then a simple push of the pawn from g2 to g3 will be mate. But where can the bishop hide?

After 1.Ba8, Black plays 1...Ra7, or 1.Bf3 Rc3. Of the other two squares, 1.Be4 may be met by either 1...Re7 or 1...Nc3, while 1.Bd5 is answered by any of Nc3, Ne7, Rc5 or Rd7.

You should already have noticed some interference effects in these moves - on the c3 and d7 squares. For example after 1.Bd5 Nc3? White plays 2.Bf3! and c3 is no longer available for the black rook.

Equally, 1.Bd5 Ne7? 2.Be4 deprives Black of the Re7 defence, so he has to play 2...Nc3 when 3.Bf3! does the trick again. Since 1.Bd5 Rd7? loses at once to 2.Bf3! we seem to be on the right track. The trouble is that 1.Bd5? is met by 1...Rc5! 2.Bf3 (or 2.Ba8 Nc3 and the knight is ready to interpose on d5) 2...Rxf5+ 3.Kh4 Rxf4.

Ah, but if the rook were on a7, not c7, it couldn't go to c5 on the first move. So that's the answer: 1.Ba8! Ra7 2.Bd5! Ne7 (2...Rd7 or 2...Nc3 is met by 3.Bf3 when the rook cannot attack the bishop) 3.Be4! Nc3 4.Bf3 and there is nothing Black can do about the threat of 5.g3 mate.

The solution is all rather reminiscent of those sliding block problems, where you have to manoeuvre wooden rectangles in order to free a specified piece. In this case, however, the task was to slide all the black pieces onto squares where they got hopelessly in each other's way.