NEW YORK (AP) — A handwritten notebook by Alan Turing, the code-breaking genius depicted by Benedict Cumberbatch in Oscar-nominated The Imitation Game, is going on the auction block.

The 56-page manuscript was written at the time the mathematician and computer science pioneer was working to break the seemingly unbreakable Enigma codes used by the Germans throughout World War II.

The notebook will be auctioned by Bonhams in New York on April 13, and is expected to bring at least $1 million.

The notebook contains Turing's complex mathematical and computer science notations. It is believed to be the only extensive Turing manuscript known to exist, according to the auction house.

It dates from 1942, when Turing was trying to break the seemingly unbreakable code with his team of cryptanalysts at Britain's World War II code and cypher school Bletchley Park.

In one entry, Turing writes about a complex calculus notation.

"The Leibniz notation I find extremely difficult to understand in spite of it having been the one I understood the best once! It certainly implies that some relation between x and y has been laid down eg, y=x2+3x ..."

Turing, who was prosecuted for being gay at a time when it was illegal in Britain, died in 1954 of cyanide poisoning. It was ruled a suicide although his family and friends believed it might have been accidental.

The notebook was among the papers he left in his will to friend and fellow mathematician Robin Gandy.

Gandy gave the papers to The Archive Centre at King's College in Cambridge in 1977. But he kept the notebook, using its blank pages for writing down his dreams at the request of his psychiatrist. Bonham describes Gandy's entries as highly personal; the notebook remained in his possession until he died in 1995.

At the beginning of his journal, Gandy writes: "It seems a suitable disguise to write in between these notes of Alan's on notation, but possibly a little sinister; a dead father figure, some of whose thoughts I most completely inherited."

In a statement through Bonhams, Turing scholar Andrew Hodges said the notebook sheds more light on how Turing" remained committed to free-thinking work in pure mathematics."

The Imitation Game, which also stars Keira Knightley, is based on Hodges' book Alan Turing: The Enigma.

Turing was convicted of indecency in 1952, and agreed to undergo hormone treatment as an alternative to imprisonment to "cure" his homosexuality.

Bonhams said the seller wished to remain anonymous. Part of the proceeds will be donated to charity.