The Last Question (1956) [pdf]
astronomy.org
astronomy.org
[ETA:] After: Ah, that one -- not the one I was thinking of. I was thinking of, apparently, a precursor. And, though I would have guessed Asimov or possibly Clarke, turns out it was (the sadly so often overlooked) Fredric Brown: https://calumchace.com/favourite-relevant-sf-short-story/