"The Nine Billion Names of God" by Arthur C Clarke (1953)
Chuck and George are computer technicians on an unusual assignment. They've been flown 12,000 miles to a remote lamasery in Tibet to supervise a Mark V computer that the monks leased from their company for a unique task; to calculate and print out all the nine billion possible names of God. This is a bit odd as computing science goes, but the monks' money is good, so what's the difference?
The difference is when Chuck and George discover what the monks expect to happen when the last name is printed and the technicians decide that it would be healthier to be elsewhere when it doesn't.
"The Nine Billion Names of God" is a tidy little short story with one of the most exquisite last lines of science fiction. It's also unusual because it's one of the few examples of pure fantasy that Clarke wrote, though the inclusion of a computer invariably gets the story pigeon holed as sci fi. Clarke's writing is neat, charming and sets up the gag and the payoff in such a way that the end isn't the frighting moment that it could have been, but almost serene in its finality. It's also sobering that when this story was written in 1953, the computer had to be a massive, barely transportable machine that requires two men, a diesel generator, and a lot hard-wired programming to work. Today, anyone who knows a bit of coding and has a dull afternoon can do what the Mark V did and you can see the results on the Internet from your smartphone.
But please let me know if you plan to run the programme to its conclusion. I have a book I'd like to finish beforehand.