The puzzle was invented by the French mathematician Édouard Lucas in 1883.
I have no reason to doubt this, but given the many legends surrounding the topic, I wonder if there is not an earlier (even "ancient") source...

(Wikipedia image.)
History of Science and Mathematics Stack Exchange is a question and answer site for people interested in the history and origins of science and mathematics. It only takes a minute to sign up.
Sign up to join this communityThe puzzle was invented by the French mathematician Édouard Lucas in 1883.
I have no reason to doubt this, but given the many legends surrounding the topic, I wonder if there is not an earlier (even "ancient") source...
The Tower of Hanoi – Myths and Maths gives a detailed historical account of the game, its predecessors and myths surrounding it, with references to original sources, it also goes in-depth into mathematical issues. The Temple of Brahma story was first reported in 1883 by Professor N. Claus (de Siam), mandarin of college Li-Sou-Stian, and was embellished by Henri de Parville, a popular science writer and chief editor of La Nature at the end of 19-th century. He first published it in Revue des Sciences in 1883, and then a year later, with pictures, in La Nature. If de Parville thought the fable would add to the game's popularity he was certainly right. Later authors made it even more colorful, adding details and modifications.
"A mandarin who invents a game about combinations, will incessantly think about combinations", says de Parville. Permuting the letters in N. Claus (de Siam) of college Li-Sou-Stian reveals Lucas d'Amiens of lycee Saint-Louis. That would be Francois Lucas born in the city of Amiens, who taught at the lycee. W.W.R. Ball, a mathematician who translated the fable from French into English in Mathematical Recreations and Essays first published in 1892, called it "a sufficiently pretty conceit to deserve repetition". But if you are not convinced here is a comprehensive bibliography on the Towers of Hanoi. Not one entry dates from before 1883.