The Last Question by Issac Asimov. A short story and not really a novel, but I digress...