In Warren Ellis & Darrick Robertson's Transmetropolitan, there are many brilliant ideas. One of my favorites is the story of the Man Who Wanted to Invent a Better City:
A huge mysterious,explosion destroys a city block aside from a single apartment. Investigating, the authorities find mysterious heiroglyphs..
The scrawl appeared to comprise three equations. The three equations seemed to represent a machine. A machine that was just 3 ideas in motion around each other. Solving the equations activated the machines.
It took ten years to evolve any workable theories as to what the creator - a half educated seventy-year-old man who worked as a janitor - was trying to do. He himself had had to invent his own mathematical language to do half the work.
It took ten full years to work out that it was a machine intended to make another City. A better City. There were mathematical expressions of ethics and love and dignity in his paperwork. For a moment there, that guy must have seen another world opening up before him. A better world. A good City.
And then the flaw in his math kicked in and the block was incinerated.
I like to imagine that this is how the fireball spell was discovered.
Jack Vance linked magic and math in right in the first story of The Dying Earth:
In this fashion did Turjan enter his apprenticeship to Pandelume. Day and far into the opalescent Embelyon night he worked under Pandelume's unseen tutelage. He learned the secret of renewed youth, many spells of the ancients, and a strange abstract lore that Pandelume termed "Mathematics."
"Within this instrument," said Pandelume, "resides the Universe. Passive in itself and not of sorcery, it elucidates every problem, each phase of existence, all the secrets of time and space. Your spells and runes are built upon its power and codified according to a great underlying mosaic of magic. The design of this mosaic we cannot surmise; our knowledge is didactic, empirical, arbitrary. Phandaal glimpsed the pattern and so was able to formulate many of the spells which bear his name. I have endeavored through the ages to break the clouded glass, but so far my research has failed. He who discovers the pattern will know all of sorcery and be a man powerful beyond comprehension."Newton published Philosophiae Naturalis Principia Mathematica largely at the urging of Edmond Halley, as he didn't feel especially inclined to share the insights he had developed. These insights included the calculations that explained the orbit of the planets, the three laws of motion, and the universal law of gravitation. Even when convinced to publish, Newton made the book intentionally difficult in order to discourage mathematical "smatterers" as he called them. He wrote that he desired that the later volumes of the work should be sensible only to those who had read and understood the earlier volumes, while others have written that without the third and final volume, the first two volumes make little sense.
This bizarre and sprawling text, which remains largely insensible to those of us who can read Latin but aren't math-wizards, introduced the world to calculus (which Newton had worked out about three decades before he could be bothered to share it with anybody else; he was rather more interested in alchemical experimentation and analyzing the floor plans of the lost Temple of King Solomon in Jerusalem, hoping to glean mathematical insights into the the Second Coming and the Eschaton). Newton's mathematical insights describe and explain some of the key ingredients of physics, which allowed other scientists to calculate what would be necessary to achieve certain effects, such as flying, stopping bullets, and orbiting the friggin' planet.