At one point in Samuel Beckett’s 1951 novel Molloy, the title character finds himself at the seaside and “lays in a store of sucking stones”:
They were pebbles but I call them stones. Yes, on this occasion I laid in a considerable store. I distributed them equally between my four pockets, and sucked them turn and turn about. This raised a problem which I first solved in the following way. I had say sixteen stones, four in each of my four pockets these being the two pockets of my trousers and the two pockets of my greatcoat. Taking a stone from the right pocket of my greatcoat, and putting it in my mouth, I replaced it in the right pocket of my greatcoat by a stone from the right pocket of my trousers, which I replaced by a stone from the left pocket of my trousers, which I replaced by a stone from the left pocket of my greatcoat, which I replaced by the stone which was in my mouth, as soon as I had finished sucking it. Thus there were still four stones in each of my four pockets, but not quite the same stones.
It occurs to him that this method won’t ensure that every stone is eventually sucked, and he works out a plan that will achieve this. This takes eight pages, “one of the longest and most detailed accounts of someone working at a mathematical problem in a work of fiction,” according to Richard Phillips in Numbers: Facts, Figures and Fiction.
Maddeningly, in the end Molloy throws away all the stones but one, “for they all tasted exactly the same.”