I read this book in high school, and I can't remember what it's called. Some kid learns he has magical ability, but only finds out later that he controls it through some kind of coin changer he's been tinkering with the whole book.
Sounds a heck of a lot like Secret of the Sixth Magic, by Lyndon Hardy. Does this cover look familiar?
I bought it in paperback in the 1980s. It was the second in a series of three which were published, years apart, throughout that decade. The three novels (each a self-contained story; each featuring a different guy as the protagonist) were:
- 1. Master of the Five Magics
- 2. Secret of the Sixth Magic
- 3. Riddle of the Seven Realms
In the first book, as the title suggests, the hero Alodar ends up studying each of the five types of magic which are known to exist in the world he inhabits. At the very end, he needs to combine aspects of all five to achieve a victory no one else could achieve. (Thereby "saving the world" and so forth.)
In the second book, a young whippersnapper named Jemidon seems to be trying something similar at first. But it doesn't work out. Alodar actually learned to use at least the bare essentials of each form of magic which he studied. Jemidon, on the other hand, studies the basic theory and introductory techniques of various types of magic, but in practice he never seems able to successfully complete any form of spell. Apparently he just lacks the necessary raw talent to ever master any known magic, no matter how hard he tries -- or something along those lines. (But he feels driven to keep trying, for reasons which I recall but won't spoil for you.)
In the course of his travels and studies, Jemidon acquires a coin-changing device which a merchant had previously used. In theory, if you dump in a handful of coins of different types of metal, in different sizes, the interior mechanism will sort them out so that each type of coin comes out of a different slot when you push a lever. (Or something like that -- my copy is boxed up in a storage unit right now.) But the device has been damaged somehow, and the coins seem to be dumped into any slot that the device feels like "sorting" them into. (So you might have a silver on top of a copper on top of a bronze, or whatever.)
From time to time, throughout the balance of the book, Jemidon experiments with this device, trying to see if there's some mathematical formula which would allow him to put in, say, five examples of each of five types of coin, in just the right sequence, and get all five of each type to come out of the correct slot when the lever is pushed. At first, this seems like a very minor subplot; a puzzle he fools around with occasionally as a hobby, and then it might not get mentioned again for a couple of chapters. But just as you said, at the climax of the book, Jemidon discovers he has a previously-unknown form of magical talent (the "Sixth Magic" mentioned in the title, of course!) and that in some way the coin changer can be very useful in helping him focus his talent to make certain things happen. (I remember a lot more detail about what his talent is, and how he finally gets the coin changer to sort things properly, etc., but I don't want to completely spoil it!)
P.S. I'm grateful to you for reminding me of this old series. I hadn't reread any of it in many years, but when I did a little online searching just now, I learned that the three books from the 1980s have recently been re-released in new editions, in order to pave the way for a fourth book in the series, published after a hiatus of almost 30 years! (Heck, I didn't even know if Lyndon Hardy was still alive after all this time.) Apparently the series has now been belatedly given a series name -- "Magic by the Numbers" -- and the fourth book, coming out this week, is titled: The Archimage's Fourth Daughter. If you hadn't prompted me to look the guy up online, no telling how long it would have taken me to notice there was finally a sequel! :-)
The laws of the five magics were being set aside. First to go were those of the high art of sorcery. Then true magic, upon which the commerce of all Arcadia depended, had been voided. And now even thaumaturgy, the engineering knowledge of the world, was under attack.
Jemidon had traced the trouble to Melizar, the strange cold being who had seemingly appeared from nowhere. Somehow, Melizar could alter or negate the laws that had always existed by using a mysterious metamagic - something which only he understood.
If the world was to be saved from Melizar, it was up to Jemidon to save it. But what could he do? He was only an outcast, unable to perform even the simplest ritual without ruining everything.
The coin changer is mentioned in this Reddit thread:
There's a coin changer in Secret of the Sixth Magic by Lyndon Hardy. It's a focus that allows it's user to disturb the laws of magic, which can then be replaced by different laws. It fits on a belt but it's not clear exactly how large it is, so I may need to find a hardback of the book.
Here's a few excerpts from the book:
In frustration, he rubbed the worn coin about his neck. There was nothing here that told him anything more than he already knew. Somehow, with greater ease than the simplest glamour, Melizar had changed the laws, replacing the substitute magic with yet another, Jemidon gripped the broken sword tighter, twisting its strange, unbalanced feeling back and forth with his wrist. Perhaps later, in the light of day, there might be something else that he could not see now. Yes, that was it—take an example of each form of magic and study the connection at a better time. He placed the sword hilt where he could easily find it again and then scooped up a handful of dominoes that lay next to the guard. He looked around for some example of traditional magic and saw Benedict's coinchanger reflecting the torchlight from a few feet away.
Jemidon stooped and pried loose the divulgenl's stiffening fingers from the device, which was still strapped to his waist. He cut it free and experimentally tripped one of the levers. A pile of worthless tokens fell into his palm and bounded onto the cavern floor.
There was no need to restore the art of sorcery, no reason to rescue a slave girl to prove that it could be done.
Or was there? Jemidon looked down at Benedict's changer. He pressed a lever, and a shower of brass and silver spilled into his hand. A single gold brandel gleamed on top of the pile. He picked it up and compared the sharp contours of the embossing with the dull indistinctness of the coin about his neck.
When the captain had gone, Jemidon turned his attention back to the coin changer and sighed. There was nothing else for him to do but wait. "If I start with three silvers before the galleons," he muttered, "then the first brandel will fall into the third column. That means that a dranbot must be next to deposit into the fifth."
While the masters exercised their skills, Jemidon emptied the coins from the changer into his palm. Quickly he sorted through the collection and reinserted them in the slit in top. He held his breath as he fingered his old worn brandel last and saw it slip away. Working the five levers one by one, he emptied the sorted coins back into his hand.
If so, the Google keywords were fiction book magic "coin changer" -"magic trick"