Useless math that became useful I'm writing an article on Lychrel numbers and some people pointed out that this is completely useless.
My idea is to amend my article with some theories that seemed useless when they are created but found use after some time.
I came with some ideas like the Turing machine but I think I'm not grasping the right examples. 
Can someone point me some theories that seemed like the Lychrel numbers and then become 'useful'?
Edit: As some people pointed out that I've published this on MSE I present a code here to find some candidates as Lychrel numbers. 
def reverseNum(n):
    st = str(n)
    return int("".join([st[i] for i in xrange(len(st)-1,-1,-1)]))

def isPalindrome (n):
    st = str(n)
    rev = str(reverseNum(st))
    return st==rev

def isLychrel (n, num_interations):
    p = n
    for i in xrange(num_interations):
            if isPalindrome(p):
                    return i
            p = p + reverseNum(p)
    return -1


for i in xrange(1000):
    p = isLychrel(i,100)
    if (p < 0):
            print i,p

 A: Binary numbers: discovered by Leibniz and of no use until the advent of computers.
A: The Radon transform, when introduced by Johann Radon in 1917, was useless, until Cormack and Hounsfield developed Tomography in the 60's (Nobel prize for Medicine 1979).
A: The theory of finite fields, introduced by Galois (but as often, using former ideas) was considered useless and as a mathematical curiosity for almost 2 centuries, until they found a use in error-correcting codes for telecommunications.
A: The most famous example is conic sections. Conic sections were of great interest to
Greek mathematicians, and their theory was highly developed in the 2-nd century BC.
However I don't know of any application until Kepler's discovery that  celestial bodies
move on conic sections. Thus 18 centuries passed between math research and the first application!
EDIT. There is a conjecture discussed in the paper
The Astronomical Origin of the Theory of Conic Sections
by O. Neugebauer, Proc. Amer. Phil. Soc., Vol. 92, No. 3, jstor, reprint - doi: 10.1007/978-1-4612-5559-8_21
that conic sections appeared for the first time in the theory of sundials. But this is only a conjecture, and Apollonius does not mention sundials. Thanks to user Miles who brought this fact to my attention.
EDIT 2. However most histories of Greek mathematics say that conic sections were invented/discovered by Menaechmus, as a tool for doubling the cube, which is of course a useless problem from our modern point of view.
EDIT 3. Parabolic mirrors is not a real application. Of course, this is a nice property of parabola, but conic sections have many other nice properties. The legend of Archimedes burning ships with them is a legend, nothing more. This is impossible, even with modern technology. And MAKING a parabolic mirror is another great technological challenge, absolutely out of reach for the ancients. Most reflecting telescopes were made with spherical mirrors, for exactly this reason: nobody knew how to make a parabolic one. To be sue, Diocles wrote a book On burning mirrors in 3d or 2nd century BC (the book did not survive), but this was pure mathematics. There was no real applications of parabolic mirrors in antiquity because they did not now how to make them.
A: Real numbers: Kroneckers "God created the integers, everything else is man made" is a prototypical continuation of the way the Pythagoreans wished the world to be, namely that everything can be measured in integers or their ratios.
A: "The Recursive Least Squares (RLE) adaptive filter algorithm that recursively finds the coefficients that minimize a weighted linear least squares cost function relating to the input signals.
It was discovered by Gauss in 1821, but lay dormant until 1950 when Plackett rediscovered the original work of Gauss" (cited from the wikipedia article).  
A: Number theory, in particular investigations related to prime numbers, was famously considered useless (e.g., by Hardy) for practical matters. Now, since "everybody" needs some cryptography it is quite useful to know how to generate primes (e.g., for an RSA key) and alike, sometimes involving prior 'useless' number theory results.
A: Investigations on the independence of Euclid's 5th axiom: about 2000 years of fruitless research, until Bolyai and Lobachevski resolved the issue (cf e.g. http://en.wikipedia.org/wiki/Non-Euclidean_geometry) and Gauss also raised his hand, but still not useful for practical problems, until Einstein developed a non-euclidean explanation of the universe.
A: Fast Fourier transform: Originally developed by Gauss in early 19th century. Gauss thought it is unworthy of publication, because there were better computational techniques. It only appeared in his collected works after his death, where nobody noticed it. Rediscovered by Cooley and Tukey, and was instantly recognized as important. See e.g. http://www.math.ethz.ch/education/bachelor/seminars/fs2008/nas/woerner.pdf
A: Negative numbers and complex numbers were regarded as absurd and useless by many mathematicians prior to $15^{th}$ century. For instance, Chuquet referred negative numbers as "absurd numbers." Michael Stifel has a chapter on negative numbers in his book "Arithmetica integra" titled "numeri absurdi". And so too were complex/imaginary numbers. Gerolamo Cardano in his book "Ars Magna" calls the square root of negative numbers as a completely useless object.
I guess the same attitude towards Quaternions and Octonions would have been prevalent, when they were initially discovered.
A: Divergent series, anyone?
It was devil's work, just a curiosity, unorthodox idea for Euler and a strange concept for Abel, Ramanujan (Abel claiming that it can't and mustn't be used for serious calculations)... but today, we use it for "real" things.
A: Fourier transforms were not useful in the 19th century, save as a tool for solving differential equations or for obtaining other theoretic results. Today of course they are ubiquitous.
A: The answer to this question depends on what one means by "useful". We have to distinguish between "useful" for other branches of mathematics or useful for Theoretical Physics or even Physics in general. Being useful in actually describing the laws of the Universe can be understood as being several orders of magnitude more important than just being useful in other areas of mathematics. For example, Generalized Complex Geometry has extensively been used in String Theory and Supergravity (for example in the classification of certain flux compactification backgrounds), and as a result Gualtieri's PhD. Thesis is close to have 900 citations in ten years. I think this would have never happened if Generalized Complex Geometry was only interesting in Mathematics. On the other hand, essentially every piece of "reasonable" Mathematics finds its place and application in Physics.
Dealing with Mathematics' applications to Physics, there are many examples of mathematical theories that in the beginning seemed useless to Physics and only years later were found to have remarkable applications in physics. To name a few:


*

*Lie groups: I once heard that when Sophus Lie introduced Lie groups, he said that finally mathematicians had created something that would never be used by physicists. Modern Physics uses Lie groups at so many levels that I cannot even begin to describe it. Let me just say that the Standard Model that describes all the known the fundamental interactionx and particles is based on the Lie group $SU(3)\times SU(2)\times U(1)$.

*Holonomy theory of Riemannian manifolds. To the best of my knowledge, when this theory was developed in the 50's it was completely unrelated to physics. However, in the 80's it found its realization in Physics through String Theory: the simplest compactification manifolds are six, seven, and eight-dimensional Riemannian manifolds of special holonomy. In addition, the scalar manifold associated to the non-linear sigma model of the effective action of certain String compactifications is again of special holonomy (tipically Kahler, Hyper-Kahler and Quaternionic-Kahler). This manifold encodes, in a way which is not completely understood, the local moduli space of the corresponding compactification.

*Kodaira's classification of singularities in elliptic fibrations. This is really a shocking example, again from the 50's. In principle completely unrelated to physics, it found its realization again through String Theory, and in particular through F-theory, which requires an elliptically fibered  Calabi-Yau manifold as a compactification space space. The singularities of the fibration crucially inform on the matter content of the theory.

*Gerbes. A gerbe is a particularly abstract construction introduced by Jean Giraud in the 70's. Surprisingly, it has recently found its realization in Physics through again String Theory (who else): many Supergravity solutions, like the self-dual string, are in fact particular instances of gerbes.
By the way, there also various examples of the opposite: mathematical theories first found by physicists and then formalized by mathematicians.
A: Perhaps homology and the simplicial methods of algebraic topology (and algebraic geometry) which are just now finding applications in topological data analysis. I think algebraic geometry and topology have often been thought to be the pinnacle of math for math's sake, but their machinery is finding uses in very modern technology.
Also, the theory of graphs and its applications to networks and network and systems analysis.
A: The Logarithmic Barrier Approach to solving Linear Programs
I just read a paper explaining interior point methods in which on finds the following statement:
"The logarithmic barrier approach to solving a linear program dates back to the work of Fiacco and McCormick in 1967 in their book Sequential Unconstrained Minimization Techniques, also known simply as SUMT. The method was not believed then to be either practically or theoretically interesting, when in fact today it is both! The method was re-born as a consequence of Karmarkar’s interior-point method, and has been the subject of an enormous amount of research and computation, even to this day." (emphases by me)
