Is there an example that a theorem in number theory is useful in another field in mathematics? I know there are two advanced approaches to number theory. That is, algebraic number theory and analytic number theory. I have heard that algebraic geometry, which generally seems completely different from number theory, is now known to be a very strong tool to attack number theory.
But what about converse?
Is there any other fields in mathematics in which number theory makes them easier? Is there any theorem in number theory which is helpful to other fields in mathematics?
 A: I think this might interest you: http://en.wikipedia.org/wiki/RSA_%28algorithm%29.
This encryption algorithm which is commonly used, is based on basic number theory.
A: This paper (Cyclotomic integers, fusion categories, and subfactors, by Calegari, Morrison, and Snyder) involves an application of number theory to the theory of fusion categories and von Neumann algebras.
A: Probably more elementary than the intent of the question, but here are two nice applications of unique factorization:


*

*(Analysis) If $N \geq 0$ is an integer and not a square, then $\sqrt{N}$ is irrational. (Contrapositively, if $N = (p/q)^2$ for some integers $p$ and $q$, then $p^2 = Nq^2$. By unique factorization, every prime factor of $N$ has even exponent, so $N$ is a square.)

*(Set theory) The set $\mathcal{S}$ of eventually-zero sequences of non-negative integers is countable; effectively, a countable union of countable sets is countable. (List the primes in increasing order: $p_1 < p_2 < p_3 < \dots$. By unique factorization, every positive integer $N$ can be written uniquely as
$$
N = \prod_{i=1}^\infty p_i^{\mu_i}
$$
for some sequence $(\mu_i)$ in $\mathcal{S}$. That is, the mapping $N \mapsto (\mu_i)$ is a bijection from the set of positive integers to $\mathcal{S}$.)
A: Number theory shows up all over the analysis of the structure of finite groups. The famous Sylow theorem states that if you have a group $G$ of order $p^nm$ where $p\not\mid m$, and there are $k$ subgroups of $G$ of order $p^n$, then $k|m$ and also $k\equiv 1\pmod p$.
Then for example suppose one wants to enumerate groups of some order, say 15.  We can write $15 = 3\cdot 5$, and taking $p=3, n=1, m=5$ in the theorem we obtain that the number $k$ of subgroups of order 3 must have both $k\mid 15$ and also $k\equiv 1\pmod 5$. The only possible value of $k$ is therefore 1, and so a 15-group must have a unique subgroup of order 3.  Similarly it must have a unique subgroup of order 5.  These together are a very strong property, and the group-theoretic upshot is that there is  essentially only one group of order 15, namely the group of integers modulo 15.
The same analysis applies for any group of order $pq$ for primes $p<q$ when $q\not\equiv 1\pmod p$, for example $3\cdot 11$.  For $p<q$ when $q\equiv 1\pmod p$, you have to use a different analysis and the answer is different.
This is an entirely number-theoretic question, so you can get some idea of the important role played by the prime numbers in the analysis of finite groups. 
This kind of analysis runs all through the theory of finite groups, so that for example one sees in papers about finite groups constant references to the prime factorizations of the sizes of groups.  (For an example, see A Millennium Project: Constructing Small Groups.)

A different but similar sort of analysis applies when one considers finite groups by their presentations.  In this kind of analysis one might say, consider a group $G$ of 10 elements. We know (from group theory) that it must contain an element $a$ with $a^2=1$ and an element $b$ with $b^5=1$.  Then (by group-theoretic arguments again) the elements $\{1, a, b, ab, b^2, ab^2, b^3, ab^3, b^4, ab^4 \}$ are all distinct and so exhaust $G$.  But we must have $ba$ equal to some element of this set.  For group-theoretic reasons we can rule out $ba\in\{1, a, b, b^2, b^3, b^4\}$, leaving $ba\in\{ ab, ab^2, ab^3, ab^4\}$.  Taking $ba = ab^n$ we find $$\begin{align}b & = ba^2 \\&= ba\cdot a \\& = ab^n\cdot a \\& = ab^{n-1}\cdot ba \\& = ab^{n-1}\cdot ab^n \\& = ab^{n-2}\cdot ba b^n \\& = ab^{n-2}\cdot ab^{2n} \\& \hphantom{=}\vdots \\&= a^2b^{n^2} \\&= b^{n^2},\end{align}$$ so finally $b = b^{n^2}$, and we must have $n^2\equiv 1 \pmod 5$. This rules out $n=2$ and $n=3$ completely, leaving $n=1$ and $n=4$.  The former is the group known as $Z_{10}$, the integers modulo 10, and the latter is the group known as $D_{10}$, which is the symmetry group  of a regular pentagon. So in this case, and in general, the number and the structure of groups of a particular order is intimately tied up with the solutions of $n^k\equiv 1\pmod p$. 
A: Number theory plays a role in dynamics. For a concrete example, consider complex polynomials of the form $f_\theta(z)=e^{2i\pi \theta} z + z^2$, where $\theta \in (0,1)$ is irrational. Then the origin is a fixed point, and a very natural and important question is whether you can linearize $f_\theta$ near this fixed point, i.e. can you find local coordinates in which $f_\theta$ is just $\xi \mapsto e^{2i\pi \theta} \xi$ ?
It turns out this question depends on some very subtle arithmetic properties of $\theta$ (Liouville, Diophantine, Brjuno...). 
A: Number theory is important in topology, specifically in arithmetic manifolds (the Wikipedia page is small but many people study this). The idea is that you can get manifolds from different number fields.
In fact, number theory seems to pop up a lot in hyperbolic geometry. The modular group acts on hyperbolic space by isometries, so its quotient has a hyperbolic metric. 
Number theory is also important in representation theory as characters always have algebraic values (I think they are even algebraic integers). This means that symmetry groups such as those studied in physics and chemistry are affected by number theory.
A: I'm going to pick two of my favorites (and might add more later). I'm going to assume that you don't want an example such as cryptography due to (a) it being the one that's always given and (b) being too applied.
Example 1: Ring Theory
One (rather cheap) answer is that number theory has many applications in ring theory (and, indeed, is in many ways originally responsible for its study). So here we see that already that number theory ...


*

*Motivates the definition of an ideal.

*Provides a wealth of examples and counterexamples of rings that are easy to play with and yet exhibit exotic properties (e.g., non-UFD rings back in the day).


We could talk at length about the interplay between ring theory and number theory, but let me give you a relatively-unknown but beautiful connection. Define the space of integer-valued polynomials $R = \text{Int}(\mathbb{Z})$ to be the set of all polynomials $f(x) \in \mathbb{Q}[x]$ for which $f(\mathbb{Z}) \subseteq \mathbb{Z}$. This is a ring, and it's in fact an infinite dimensional $\mathbb{Z}$-module with basis
$$
\left\{\binom{x}{n} = \frac{x(x-1)\cdots (x-n+1)}{n!} \mid n = 0,1,2,\ldots \right\}.
$$
This is a very interesting ring that has connections to algebraic $K$-theory and is arguably among the most accessible and nicest examples of a Prüfer domain, which is essentially what you get when you take a Dedekind ring and relax the assumption that all ideals are finitely generated.
So what does this have to do with number theory? Well apart from the obvious answer that it has to do with polynomials over a number field (and hence many of the properties of $\text{Int}(\mathbb{Z})$ are established number theoretically), a connection comes from the ideal structure of $R$. The integer-valued polynomials form a height two ring, with ideals falling into two distinct categories. First, there are ideals of the form $f(x)\mathbb{Q}[x] \cap \text{Int}(\mathbb{Z})$ for each irreducible $f(x) \in \mathbb{Q}[x]$. Each of these is of height one, lying above $(0)$. These are as interesting in this discussion.
The other, more relevant type of prime ideals are in two layers. The remaining height one prime ideals in $R$ are exactly those of the form $(p)$ for some prime $p$. Now for a fixed prime $p$, what are the height $2$ ideals lying over $(p)$? As it turns out, these are parametrized by the elements of the $p$-adic integers $\mathbb{Z}_p$. Specifically, for each prime $p$ and each $\alpha \in \mathbb{Z}_p$ the set
$$
\mathfrak{M}_{p,\alpha} = \{f(x) \in \text{Int}(\mathbb{Z}) \mid f(\alpha) \in p\mathbb{Z}_p\}
$$
is a maximal ideal in $\text{Int}(\mathbb{Z})$ lying over $p$. (It's also not finitely generated!) This characterization is really only possible thanks to our pre-existing understanding of the $p$-adic completions of $\mathbb{Q}$ and their properties.
It's also worth noting that this ring and its brethren are still very much a subject of intense study in ring theory with many interesting questions about their structure still unanswered.
Example 2: Moonshine
As a second example that's even farther afield, consider monstrous moonshine. This started with the observation that the Fourier coefficients of the $j$-function (a function of great importance in the study of modular forms within analytic number theory) are expressible as linear combinations of the dimensions of the irreducible representations of the monster group (the largest of the $26$ sporadic groups). This came as a huge surprise to everyone involved in its discovery, since there was no reason to expect a connection between these two objects at the time. In fact, the current proofs we have of the connection have yet to really shed light on why the $j$-function and $\mathbb{M}$ should be connected in this way.
While it's beyond the scope of your question to get into the details, our current understanding of moonshine establishes connections between the representations of the monster (from group theory), automorphic forms (from analytic number theory), and (of all things) physics (specifically conformal field theories).
A: Number theory is useful in logic. For example, in computability theory Gödel's $\beta$-function is used to show that quantifying over finite sequences is an arithmetic operation. The proof that the $\beta$-function works requires the Chinese remainder theorem. Another example is showing that $\mathbb{N}$ is definable in $(\mathbb{Z},+,\cdot)$ using Lagrange's four-square theorem. The fundamental theorem of arithmetic is heavily assumed in coding formal sentences.
A: In descriptive set theory and general topology, it is a basic fact that a countable power of the countable discrete space is homeomorphic to the irrationals: $N^N\approx J$.  The easiest proof (if you know elementary number theory) is to use continued fractions.  Given an irrational number $x\in J$, let $$x=a_0 + \cfrac{1}{a_1 + \cfrac{1}{a_2 + \cfrac{1}{a_3 + \cdots}}},$$
where the $a_i$ are integral and $a_i>0$ for $i>0$.
This defines an explicit bijection between $J$ and $Z\times N\times N\times N\times\cdots$, and it is trivial to check that is is a homeomorphism.
Consider the standard algorithm for computing the continued fraction of an irrational.  Its individual steps are continuous (on $J$!), so if $x$ and $y$ are close (in $J$), they will generate identical $a_0,a_1,a_2,\dots$ up to a point, and hence they correspond to sequences that are close in the product topology.
All of the proofs of Matiyasevich's theorem rely on some fancy elementary number theory, usually involving Pell's equation.  The original proof furthermore relied on a mildly complicated exercise involving the Fibonacci numbers.
As a curiosity, the first steps towards proving this theorem were taken by Martin Davis and Hilary Putnam, where they proved a basic result, assuming the conjecture that there were arbitrarily long arithmetic progressions of prime numbers.  Their paper was peer-reviewed by Julia Robinson, who came up with a different proof, not assuming any conjectures.  As a result, their original proof was never published, although now it might be of interest in light of the Green-Tao theorem.
