This problem is taken from the UKMT Mathematical Challenges.
Published February 2012.
Help With Mathematical Display