Whether it was in books or in conversation, Mr. Smullyan had a knack for adding a dash of whimsy to the logic puzzles he devised.