What are some examples of mathematics that had unintended useful applications much later?
I would like to know some examples of interesting (to the layman or young student), easy-to-describe examples of mathematics that has had profound unanticipated useful applications in the real world. For my own purposes, the longer the gap between the theory and the application, the better.
My purpose is to explain to the people I know why studying theoretical mathematics isn't a waste of time, and more importantly to motivate students. The reason I would like to have a longer time gap is that I want it to be clear that the mathematicians could not possibly have had the future applications of their work in mind.
A good example of this is Robert Lang's TED talk about origami, in which he describes how origami artists applied circle packing to their own work to construct designs, and how later engineers used origami to construct devices that can be transported compactly and then unfold to fill a larger space. His premier example is that of transporting large telescope lenses into space; since they are made of glass, they have to be carefully folded, and not just stuffed into a canister.
Other examples are how number theory was developed and later used in cryptography, and how polynomials were studied and later found to be useful in all sorts of applications. These have drawbacks, however. Cryptography and its uses in computer science are basically still math, and it's quite complicated. It's also not so clear that people studying polynomials weren't aware of their many potential applications.
Are there other good examples that fit my criteria? I think the latter two examples I mentioned could also be good examples, if presented correctly, but I'm not sure how best to go about that (and I am most interested in hearing of other connections).
Edit: If my motivation (or its wording) bothers you, please just ignore it and instead note that surprising later applications and connections make for interesting and engaging talks.
Solution 1:
A classic example is conic sections, which were studied as pure math in ancient Greece and turned out to describe planetary orbits in Newtonian physics (about 2000 years later).
Solution 2:
Radon Transform is an obscure piece of mathematics which study the integral transform consisting of the integral of a function over straight lines. This was studied as early as 1917.
In the second half of $20^{th}$-century, this piece of mathematics find its uses in medical imaging when computer becomes available. It is now widely used in all sort of tomography, to reconstruct the inner image of a patient using scattering data of penetration waves from multiple directions.
Next time when you or your family need to go to a doctor and takes a CT, MRI or PET. You are being benefited by this piece of mathematics.
Solution 3:
David Hilbert said: "I developed my theory of infinitely many variables from purely mathematical interests and even called it 'spectral analysis' without any pressentiment that it would later find an application to the actual spectrum of physics."
C. Reid. Hilbert–Courant. Springer-Verlag, New York, 1986.
Solution 4:
"No one has yet discovered any warlike purpose to be served by the theory of numbers or relativity, and it seems very unlikely that anyone will do so for many years."
Written by G.H. Hardy in A Mathematician's Apology in 1940. (Chapter 28, page 140)