Alan Turing's notebook from 1942 is set to star in a sale at Bonhams on April 13 with a valuation of up to $1m.
At the time, he was in America assisting the US Navy with the development of the Bombe (a computer designed to decrypt the Naval Enigma).
Just over 10 years later, in 1954, he would kill himself whilst undergoing chemical castration for the crime of being gay.
Cassandra Hatton of Bonhams told the Financial Times that the notes relate to Turing's later work in computer theory: "He is working on logic and the foundations of mathematics with the aim of creating a universal language for a universal computing machine.
"To be able to look in and see his thought processes is extremely important ��� you see the types of things in mathematics that really bothered him, what he thought needed to be worked on."
The notebook was left to Robin Gandy, a friend and mathematician who edited his papers after his death.
In an interesting twist Gandy, who was also gay, filled the notebook with a series of highly personal notes discussing his dreams and sexuality between Turing's equations.
He writes at one point: "It seems a suitable disguise to write in between these notes of Alan's, but possibly a little sinister; a dead father figure, some of whose thoughts I most completely inherited."
Turing was a pioneering mathematician, best known for his work cracking the German enigma code during the second world war.
The lot is likely to see a boost in its value following the recent release of The Imitation Game, a film about his arrest and trial starring Benedict Cumberbatch.
Please sign up to our free newsletter to receive exciting news about memorabilia auctions.