A Weymouth mathematician and his young son have unlocked a 400-year-old card trick with links to William Shakespeare.

Colin Beveridge unravelled the mathematical secrets of the Elizabethan card trick after becoming fascinated by it, having seen it in a page of the diary of theatrical entrepreneur and impresario, Philip Henslowe.

Henslowe built and owned the Rose Theatre in 1587 in Southwark, and several Shakespeare plays - including Hamlet and Henry VI Part I - are recorded in the diary as having been staged there.

The diary, called MS VII, is colloquially known as ‘Henslowe’s Diary’ but it is actually an account book of his business concerns, mostly running the Rose on London’s Bankside.

The page, dating from the 1590s, describes a card trick to guess the number a volunteer is thinking of.

The performer of the trick will correctly identify the number by counting cards set out in a clockface. They say “abracadabra!” when they turn over the card at the end.

MS VII f18v (the page of 'Henslowe's diary' from which the card trick originated) MS VII f18v (the page of 'Henslowe's diary' from which the card trick originated) (Image: With kind permission of the Governors of Dulwich College) Mr Beveridge said: "My friend wrote a book on the math behind Shakespeare and he thought I would be interested in the trick and sent it to me. 

"There is no reference to this trick anywhere, as far as I know and no one has written about it before.

"There is very little known from tricks in that era."

A mathematical consultant and writer from Weymouth, Mr Beveridge was helped in unravelling the maths behind the trick by his 10-year-old son, Bill Russ.

Mr Beveridge said: "I had an explanation for it that was correct, but clunky. After I ran it through with Bill, he asked if it would still work if you changed a 15 in the trick to a different number - and it did. 

"That unlocked a much simpler explanation of the mechanics behind the magic."

Bill, a Year 6 pupil at Beechcroft St Paul's Primary School is also a big maths fan like his father and likes the idea of Elizabethan-era people enjoying the trick.

He added: "I like the trick, it's clever. It's fun to imagine them doing it 400 years ago."

Colin sat on the Chapelhay steps in WeymouthColin sat on the Chapelhay steps in Weymouth (Image: HAYDN-WHEELER)

The trick and how it works have been published at maths news blog The Aperiodical.

Mr Beveridge added: "By modern standards, it's quite a simple trick involving a secret number and some counting, but the algebra shakes out nicely.

"I think a lot of math looks magical until you understand it.

The mathematician, who organises the monthly Weymouth MathsJam meeting for puzzle enthusiasts, is keen to show that maths isn't just useful, but delightful in its own right.

He said: "It's like doing the crossword or solving sudokus, but better - you can get the same sort of rush from figuring out a good problem and seeing how it all fits together."

Weymouth MathsJam meets in the Dry Dock at 7pm on the penultimate Tuesday of each month. 

Mr Beveridge wrote Cracking Mathematics, The Maths Behind..., and several books in the For Dummies series.

He also has a PhD in the maths that governs the Sun's atmosphere from the University of St Andrews.