A 56-page handwritten notebook that belonged to Second World War Nazi code breaker and computer pioneer Alan Turing, played by actor Benedict Cumberbatch in the film The Imitation Game, sold for more than $1m (£680m) in New York, Bonhams said on 13 April.

Turing, a British mathematical genius, worked at the UK government's war-time codebreaking centre, Bletchley Park. He led a team of cryptographers who cracked the wartime Enigma code, which the Germans had considered unbreakable. Their work is credited with hastening the end of the war and saving countless lives.

Cassandra Hatton, senior specialist in Bonhams' fine books and manuscripts department, said the result of the auction is a testament to Turing's legacy.

The notebook, which had never been seen in public, is considered the only existing, extensive manuscript by Turing. In it, which dates back to 1942 and was left to his friend Robin Gandy, Turing worked on mathematical formulas and the basics of computer science, giving insights into the workings of his brilliant mind.

Gandy added his own notes between the pages of Turing's musings and kept the notebook hidden until his death.

Turing, a homosexual, never received credit for his ground-breaking work during the war. He committed suicide in 1954 at the age of 41 while receiving hormone treatment. It was an alternative to imprisonment after he was charged with gross indecency in 1952 for having sex with a man.

Sixty years after his death, Turing received a royal pardon by Queen Elizabeth for his conviction.