When I was at Cambridge, there was a legendary don who was famed for his absent-mindedness. In fact, he used to tell stories about it. When he was working through a problem in his head, he lost all awareness of what was going on around him. He was even capable of walking up to his own front door, ringing the bell, and when there was no reply, muttering, "Bother! He's out!" and walking away.
His best story told how he suddenly "came to" and realised he was lying in bed on a sunny afternoon. Why should this be? He wasn't ill! Reconstructing his movements, he remembered that he had promised to play tennis with a friend and had gone to his room to change, but he was concentrating on solving a problem and so the sheer act of taking off his clothes had led to him going to bed!
On a not dissimilar level, there is a legendary Cambridge story about the young Bertrand Russell walking along King's Parade and suddenly exclaiming to himself, "Good lord! The ontological argument is true!" He then stood stock-still for several minutes before saying, "No it isn't!" and continued on his way.