As he tells it, he began worrying about getting old long ago, while he was still a young graduate student at Caltech. When he talked to other graduate students there, “I could see that they wanted to do physics, come hell or high water, for the rest of their life,” he said. “And I didn’t quite feel that way.”

He ran in a fast crowd. “Alan was one of the amazing cadre of Kip Thorne relativity students in the 70s,” said Michael Turner, a cosmologist and former Caltech student now retired from the University of Chicago. (In 2017, Dr. Thorne, with Barry Barish and Rainer Weiss, won the Nobel Prize in Physics for the discovery of gravitational waves.) Richard Feynman, Caltech’s resident eccentric genius, would drop by and dazzle them with impromptu blackboard calculations.

“I could see their minds working and just see that they just had a very, very high capacity and ability to see things,” Dr. Lightman said.

Dr. Lightman would go on to have his own moments. He described one such incident in a memoir, “Searching for the Stars from an Island in Maine,” when, early in his research career, a difficult calculation fell suddenly into place: “My head was floating off my shoulders. I felt weightless. I was floating. And I had no sense of my self, where I was, or who I was. I did have a feel of rightness.”

Many scientists will tell you these are the most precious moments in their lives. Dr. Lightman said that it had happened to him five or six times in his scientific career. But he believes most theorists dry up by the age of 40 or so. “You just seem to have more of what it takes at a young age,” he said. “It’s kind of like athletic limberness.”

In 1989, at age 41, he joined M.I.T. with a rare joint appointment in physics and humanities.

“I love physics, but what was even more important to me was leading a creative life,” Dr. Lightman said. “And I knew that writers could continue doing their best work later in life.”