What are some examples of when Mathematics 'accidentally' discovered something about the world?
Solution 1:
The planet Neptune's discovery was an example of something similar to this. It was known that Newtons's Equations gave the wrong description of the motion of Uranus and Mercury. Urbain Le Verrier sat down and tried to see what would happen if we assumed that the equations were right and the universe was wrong. He set up a complicated system of equations that incorporated a lot of ways contemporary knowledge of the universe could wrong, including the number of planets, the location and mass of the planets, and the presences of the forces other than gravity. He would eventually find a solution to the equations where the dominating error was the presence of another, as of yet undetected, planet. His equations gave the distance from the sun and the mass of the planet correctly, as well as enough detail about the planet's location in the sky that it was found with only an hour of searching.
Mercury's orbit's issues would eventually be solved by General Relativity.
Solution 2:
Here's a rather different example which came up recently (see the Journal of Recreational Mathematics):
A couple of mathematicians were studying juggling. They came up with a way to encode the 'ball catch' patterns as simple numeric sequences. Then they derived the sequences for all known juggling patterns, and inferred from them a set of rules governing which number sequences can be legal 'juggling' sequences and which cannot. Then they worked the rules backwards, and re-derived all the sequences that they had started with - plus one other. It then turned out that it is in fact possible to juggle according to that extra number sequence. In fact, one of the mathematicians described the resulting juggle motion as 'hauntingly beautiful'.
Think - just a little simple fiddling with numbers uncovered a way to juggle that had gone unnoticed for thousands of years.
Solution 3:
Write down Maxwell's equations in a vacuum:
$$\nabla \cdot \vec{E}=0$$ $$\nabla \cdot \vec{B}=0$$ $$\nabla \times \vec{E}=-\frac{\partial \vec{B}}{\partial t}$$ $$\nabla \times \vec{B}=\mu_0\epsilon_0\frac{\partial \vec{E}}{\partial t}$$
Note the vector identity $\nabla\times(\nabla \times \vec{X})=\nabla(\nabla\cdot\vec{X})-\nabla^2\vec{X}$.
Apply this to the third and fourth equations to get:
$$\frac{\partial^2 \vec{E}}{\partial t^2}=\frac{1}{\mu_0 \epsilon_0}\nabla^2 \vec{E}$$ $$\frac{\partial^2 \vec{B}}{\partial t^2}=\frac{1}{\mu_0 \epsilon_0}\nabla^2 \vec{B}$$
That is the electric and magnetic fields satisfy the wave equation. That is, electromagnetic waves exist! Further, since $\frac{1}{\mu_0\epsilon_0}=c^2$, we know they travel at the speed of light.
Solution 4:
Quasicrystals. Aperiodic tilings of the plane and space were discovered by mathematicians, starting from Robert Berger's work on Wang tiles in the $1960$'s. Physical materials exhibiting these properties were found in the $1980$'s by Dan Shechtman, who won the Nobel Prize for Chemistry in $2011$ for this work.