It has always seemed that it would be a great idea to write fiction which managed to painlessly get across ideas in science or mathematics, but usually the outcome of attempting to do this is something distinctly worthy that lacks any entertainment or effectiveness as a narrative.
In L.A. Math, James Stein has managed the closest approximation to getting it just right I've yet to see. The stories work as detective tales, but the denouement relies not on sophisticated detection but on mathematical deduction. The style is quite old-fashioned - I'd liken it to a cross between P. G. Wodehouse and the classic American crime writer Ellery Queen - but I don't see this as a bad thing. The storylines might not be soul-searching literary fiction, but they are entertaining and engaging tales. The main character, Freddy Carmichael (we're already getting that Wodehouse vibe) is a detective, but struggles with solving cases where maths features strongly. Luckily, though, his slob of a landlord and housemate, Pete Lennox, has an incisive mathematical mind and helps Freddy out when he's at a loss.
Admittedly no one is going to read this book and become a maths star, but there's always a pleasure in having a chance to think through the mathematical puzzle and take on the detective. In this respect, I thought the first story was disappointing, as it's not possible to conclusively come to the same result as the detective. It's one of those 'eliminate combinations' logic problems; we are trying to work out who a dubious contact is meeting. We are first told 'If he doesn't meet Hazlitt, he is meeting Burns', but later told this is 'totally wrong'. Our detective assumes that this statement being totally wrong means that the suspect is meeting neither Hazlitt nor Burns. But all that's required for the statement to be totally wrong is that if the suspect doesn't meet Hazlitt he doesn't meet Burns either. It still leaves open the possibilities that the suspect does meet only Hazlitt or he does meet both of them. This might seem like nit-picking, but the whole point of an exercise like this is that it has to work to get the point across.
However, that is a one-off and the rest of the crime puzzles provide both entertainment and the chance to learn a few maths tricks, and in each case there's an appendix to dig into the topic in a little more depth, if you're that kind of a person. (I admit it. I'm that kind of a person.) Fun for any crime-fiction lover who fancies a spot of mathematical adventuring, or vice versa.