The story is about two beings, living since the beginning of the universe (one of them, the protagonist of the book, is "old Qfwfq" - it's not a misprint -, a mysterious being that claims to have witnessed all the main events in the history of Universe and Earth) who make bets on the future evolution of the universe to pass time. They start betting about whether atoms will form or not, or how much stars will grow before stabilizing, and end up betting on the minutest events, such as what turn a woman will take walking on a street (all this before the woman is even born, or Earth formed!).
The mathematics this should take is never mentioned if not en passant (at the end of the tale the two beings live among humans and it's briefly mentioned they use computers to make their calculations), but the story is a reflection on finding a pattern in the universe and how this pattern seemingly degenerates again into chaos when the amount of information is too high to visualize.
Furthermore, a humorous idea proposed is that numbers were invented (or evolved) little by little, and "user-friendly" numbers such as integers were the last to appear: A quel tempo, di numeri ce n'erano soltanto due: il numero e e il numero pi greco. ("At that time there were only two numbers: e and pi").