A história é " A última resposta " de Isaac Asimov.
Publicado pela primeira vez na edição de janeiro de 1980 do Analog Science Fiction and Fact , também contido nas coleções The Winds of Change e Other Stories (1983), A melhor ficção científica de Isaac Asimov (1986) e Robot Dreams (1986).
Depois que Matemáticos Chibchas identificou corretamente o autor, eu pude encontrá-lo por uma pesquisa no google por "asimov god afterlife".
Eu encontrei esta página falando sobre as visões teológicas de Asimov, com este pequeno resumo descrevendo a história :
This idea is carried to its fullest extent in the short story "The Last Answer" (1986). An atheistic physicist dies, and is carried to what he believes to be an afterlife. He soon finds out that he is the prisoner of an all-powerful being that used a "nexus of electromagnetic forces" to imitate the workings of his brain, in essence giving the man immortality. The catch is that the man's purpose for eternity is simply to think. The universe was created for the amusement of the all-powerful being, and the man has no choice but to exist for all eternity to please the being. The last answer that the man intends to spend eternity thinking about, is how to end the existence of "god." "For what could any Entity, conscious of eternal existence, want-but an end? (P. 356)"
A página da Wikipedia para a história confirma que esta é realmente a história que eu estava pensando.
A formulação exata do parágrafo final:
Carefully, and with the thrill of purpose, Murray began to think.
He had plenty of time.