What are examples of well received mathematical papers in which the author provides detail on how a surprising solution to a problem has been found.

I am especially looking for papers that also document the dead ends of investigation, i.e. ideas that seemed promising but lead nowhere, and where the motivation and inspiration that lead to the right ideas came from.

By "surprising solution" I mean solutions that feel right at first reading and it isn't clear why they haven't been found earlier.

Recollections of an exciting era(1977) recounts how he came up with his matrices while trying to “take the square root of a sum of four squares”. $\endgroup$ – Francois Ziegler Nov 21 '18 at 18:40