In a collection of problems by the famous "father of composition", Samuel Loyd, the task below is linked to a short story entitled "Charles XII at Bender".
This is what happened to the famous Swedish warrior-king.
The Swedes had just repulsed an attack by the Turks, who were besieging the army of Charles XII at Bender. At nightfall, the fighting ceased, the cannons fell silent, only the occasional rattle of handguns.
In one of the fortress chambers there was a table with chess set up by the open window. At the table the Swedish king and his minister Grothusen were fighting a bloodless battle after the bloodily repulsed enemy assault. The king was playing white. At one moment a position like the one in the diagram below appeared:
Each diagram comes with a small chess engine - allowing you to play against it, ask for hint or the solution (first move).
Meanwhile it was getting completely dark and the king ordered to light a candle. The servant placed it on the window sill. Charles XII looked at the chessboard for a moment and announced defeat in 3 moves. But just as he was about to make the right move, a bullet buzzed and fell through the window, shattering the white knight.
Grothusen broke off frightened, but the king with a nod commanded him to remain where he was.
- This is a very interesting position," he said, "and I have no intention of giving it up for one stupid bullet...
The minister sat back and with a somewhat trembling hand reached for the second jumper, handing it to the king in place of the broken one. But Charles XII pushed away the figure that was handed to him.
- I can do without this knight. And without it I can give you defeat, admittedly not in three, but in four moves.
As soon as the king finished speaking, the second bullet buzzed, knocking down the h2 pawn. Grothusen jumped on his feet, pale and shaking with fear.
Your royal highness ! - He shouted, standing prudently outside the open window - Please, let's move away from here! This candle...
If they are shooting at us - answered the king calmly - they are not very good marksmen. It looks rather as if you have some friend among Turks, who doesn't want to let you lose this game... But it won't help you much, because without this pawn I can still give you defeat, although this time only in five moves...
Quoting this story in "Baltische Schachblătter" in 1900, the famous composer F. Amelung points out, that if in the diagram position the first ball had knocked down - instead of the knight - the rook g7, white would have been able to mate anyway... in 6 moves!
And here are further solutions to all problems ( scroll down the page, please ):
Diagram1, checkmate in 3 moves: 1. Rxg3
Diagram2, checkmate in 4 moves: 1. hxg3
Diagram3, checkmate in 5 moves: 1. Rb7
Diagram 4, checkmate in 6 moves: 1. Nf3