Where is number theory used in the rest of mathematics? Where is number theory used in the rest of mathematics?
To put it another way: what interesting questions are there that don't appear to be about number theory, but need number theory in order to answer them?
To put it another way still: imagine a mathematician with no interest in number theory for its own sake.  What are some plausible situations where they might, nevertheless, need to learn or use some number theory?
Edit It was swiftly pointed out by Vladimir Dotsenko that the borders between number theory and algebraic geometry, and between number theory and algebra, are long and interesting.  One could answer the question in many ways by naming features on that part of the mathematical landscape.  But I'd be most interested in hearing about uses for number theory that aren't so obviously near the borders of the subject.
Background In my own work, I often find myself needing to learn bits and pieces of other parts of mathematics.  For instance, I've recently needed to learn new bits of analysis, algebra, topology, dynamical systems, geometry, and combinatorics.  But I've never found myself needing to learn any number theory.  
This might very well just be a consequence of the work I do.  I realized, though, that (independently of my own work) I knew of no good answer to the general question in the title.  Number theory has such a long and glorious history, with so many spectacular achievements and famous results, that I thought answers should be easy to come by.  So I was surprised that I couldn't think of much, and I look forward to other people's answers.
 A: Number Theory is used in Algebraic Geometry when studying problems in characteristic $p$. But also in characteristic 0, some algebraic varieties arise from arithmetic constructions. Hilbert modular surfaces or Shimura varieties, for example. Also, the recent classification of fake projective planes by Prasad & Yeung (2007) uses Number Theory in a crucial way: in fact, this problem is equivalent to the enumeration of discrete cocompact subgroups of $PU(1,2)$. And the study of the Ring of Endomorphisms for abelian varieties needs the understanding of some Number Theory, especially number fields and quaternion algebras. I guess that there are countless examples like these.
A: Here are a few examples. In some, number theory provided an essential motivation. In the others, it plays a more direct role. 
1) Are there nonisometric Riemannian manifolds that are isospectral (eigenvalues of the Laplacian match, including multiplicities)? An example was given by Milnor in the 1960s, which depended on prior work of Witt involving theta-functions (modular forms) of lattices. In the 1980s, Sunada created examples systematically by exploiting the analogy with the number theorist's construction of pairs of nonisomorphic number fields that have the same zeta-function. These number field pairs are found with Galois theory (find a finite group $G$ admitting a pair of nonconjugate subgroups having appropriate properties and then find a Galois extension of the rationals with Galois group isomorphic to $G$). There is a well-known analogy between Galois theory and covering spaces, and Sunada used this to translate the group-theoretic conditions for Galois groups into the setting of Riemannian manifolds. For more on this story, see the Wikipedia page here, where you'll see that the nonisometric isospectral pairs found between the work of Milnor and Sunada were closely related to other parts of number theory (quaternion algebras over the rationals).  
2) Lens spaces are distinguished from each other using quadratic residues.
3) Knot theory uses continued fractions. See one of the answers to the MO question here. (Some of the other answers to that question could also be regarded as more applications of number theory, to the extent that you consider finite continued fractions to be number theory.)
4) The construction of Ramanujan graphs uses number theory. Also look here.
5) Frobenius proved that the only ${\mathbf R}$-central division algebras that are finite-dimensional are ${\mathbf R}$ and the quaternions. If you want to see infinitely many other examples of noncommutative division rings that are finite-dimensional over their centers, especially if you want examples that are more than 4-dimensional, you probably should learn number theory since the simplest examples come from cyclic Galois extensions of the rationals. Verifying the examples really work requires knowing a rational number is not a norm from a particular number field, and that amounts to showing a certain Diophantine equation has no rational solutions.
6) The classical 
induction theorems of Artin and Brauer about representations of finite groups were motivated by the desire to prove Artin's conjecture on Artin $L$-functions. Although number theory appears in the proof in the context of algebraic integers, the main point I want to make is that a conjecture from number theory provided an essential motivation to imagine the theorems might be true in the first place. 
7) Several concepts of general importance in mathematics were originally developed within number theory. The most prominent example is ideals, which were first defined by Dedekind in his work on algebraic number theory. The first examples of finite abelian groups were unit groups mod $m$ and class groups of quadratic forms. The first finitely generated abelian groups to be studied as such were unit groups in number fields (Dirichlet's unit theorem). The first application of the pigeonhole principle was in Dirichlet's proof of the solvability of Pell's equation. The motivation for Steinitz's 1910 paper setting out a general theory of fields was Hensel's creation of $p$-adic numbers. 
A: This seems not quite in the spirit of the original question, but I couldn't resist mentioning some work which was presented at a recent PIMS (applied) maths colloquium here:

On ringing effects near jump discontinuities for periodic solutions to dispersive partial differential equations.
  Kenneth D. T.-R. McLaughlin, Nigel J. E. Pitt.
  (arXiv 1107.1571)

My limited understanding of the story, which should be taken with a big lump of salt, is as follows:
For certain nonlinear PDEs with a periodic boundary condition, one can write down a Fourier series that represents a weak solution, and then faces the issue of determining in what sense this series converges to the solution. Bizarrely (to my eyes) the shape of the solution is different for rational and irrational times; and to understand what happens at irrational times, the authors have to deal with exponential sums of a form encountered in analytic number theory.
Furthermore, Theorem 1.5 in this paper, which demonstrates a kind of "Gibbs phenomenon" for these solutions, is proved for irrational values of $t$ satisfying a complicated condition depending on the continued fraction expansion of $t$.
(According to the speaker (McLaughlin), the collaboration started while he was sitting in number theory lectures given by the first author, reading a PDEs paper, and realizing that the sums on the page in front of him were awfully like the sums on the board.)
A: 1) For your third interpretation I have at least one relevant experience of my own - "factor systems" (some) number theorists deal with when talking about central simple algebras over number fields did contribute to the development of homological algebra in general, and learning that bit of number theory somehow expanded my homological algebra horizons a bit. 
2) Sometimes, it's hard to say where the border between number theory, commutative algebra, and algebraic geometry lies. Around that "triple point" there should be many potential answers.
3) It would be interesting to see examples in the same spirit as how the $n$-factorial conjecture ended up being proved using quite advanced algebraic geometry. Maybe a good candidate along those lines is this result of Kanel-Belov and Kontsevich that uses reduction to characteristic $p$: "The Jacobian Conjecture is stably equivalent to the Dixmier Conjecture", http://arxiv.org/abs/math/0512171 
A: One thing I completely forgot of was reminded to me by the reference to Feit-Thompson conjecture: applications of number theory/basic Galois theory to characters of finite groups and to structure theory of finite groups, e.g. Burnside's theorem stating that a group of order $p^nq^m$ with $p,q$ prime is solvable.
A: If Arakelov geometry counts as number theory, then, http://arxiv.org/pdf/math/0401029v1.pdf demonstrates the computation of the Analytic torsion (a purely analytic object involving the product of determinants of laplacians) using the Arithmetic Riemann-Roch theorem.
A: Elliptic curves are the basis for a type of public key cryptography known as elliptic curve cryptography.
Also I attended a colloquium recently that talked about the applications of elliptic curves to string theory.
A: Already one of the Bernoullis, I think Daniel, asked Euler what number theory was good for. He replied that solving diophantine equations such as $x^2 + y^2 = 1$ and similar ones via rational parametrizations would allow to transform integrals $\int dx/\sqrt{1-x^2} $ into rational ones. Perhaps not that exciting today, but it's a time-honoured answer.
A: The uniqueness of the finite Ree groups of type $^2G_2$ was established by E. Bombieri using extremely tricky number theoretical methods (involving involved elimination methods). As Stephen D. Smith wrote in his review on MathSciNet:

This result has considerable importance in the classification of finite simple groups. Ordinary mortals such as the present reviewer are overawed by the author's tour de force.

(Bombieri, Enrico; Odlyzko, A.; Hunt, D.
Thompson's problem (σ2=3).
Appendices by A. Odlyzko and D. Hunt,
Invent. Math. 58 (1980), no. 1, 77–100.)
A: It also finds use in the theory of information theory and algorithms (which are essentially mathematical topics); for example, number theoretic transforms are arguably the neatest way of achieving the optimal known complexity for multiplying arbitrarily long integers on a classical computer. Other topics also involving some amount of number theory are hashing, random number generation and error detection & correction.
A: Well, the Fibonacci sequence belongs to number theory. Doesn't it ? Yet it is fundamental in many parts of Mathematics, at least in sorting algorithms.
A: *

*Algebraic topology and theory of formal groups use arithmetic properties of binomial coefficients like
$$d(n)=\left({n\choose1},{n\choose2}, \ldots, {n\choose n-1}\right)=\begin{cases}
p,& \text{if } n=p^k;\\
1,& \text{else};\\
\end{cases}$$
$$\left({n\choose 2},{n\choose 3}, \ldots, {n\choose
n-2}\right)=d(n)d(n+1)$$
(and something more serious, see Hazewinkel, M. Formal groups and applications. 1978).

*Discrete integrable systems (and algebraic topology as well) use different kinds of special functions especially elliptic ones.
A: If you want to classify 3-manifolds, then at some point you need to start caring about number theory. Most (closed, aspherical, atoroidal) 3-manifolds are hyperbolic, and so are the quotient of hyperbolic 3-space by a Kleinian group.  Understanding such groups requires number theory.  (I'm not an expert on this topic, so I encourage others to edit this answer to make it better.)
A: An old example from differential topology: In surgery theory -- the work of Kervaire and Milnor on exotic spheres -- you need to know a sufficient condition for a homogeneous quadratic equation over $\mathbb Z$ in many variables to have a nontrivial solution.
A: The book The Unreasonable effectiveness of number theory mentions amongst other things that number theory crops up in stability questions in dynamical systems, e.g. the small-divisor problem in KAM-theory where diophantine approximation is used.
Another book with several applications is:
Number Theory: An Introduction to Mathematics whose blurb contains "As a source for information on the 'reach' of number theory into other areas of mathematics, it is an excellent work."
A: Assume you are a (differential) geometer and you want to construct locally symmetric spaces of higher rank. Such a space must have a (globally) symmetric space $X$ as its universal covering space, and this can be written as $X=G/K$ where $G$ is the identity component of the isometry group of $X$ and $K$ is the stabiliser of some point in $X$. To get a locally symmetric space of finite volume, you then have to find a lattice $\Gamma\subset G$, i.e. a discrete subgroup such that $\Gamma\backslash G$ has finite volume with respect to the (right-invariant) Haar measure on $G$. Then if $\Gamma$ is torsion-free you get $\Gamma\backslash X$ as a locally symmetric space.
Now how does one construct such lattices? One method is by arithmetic groups, and it is a matter of taste whether you want to consider them as objects of number theory. Suffice it to say that their study requires a lot of techniques from other areas in number theory in a broad sense. It is quite technical to define an arithmetic group, but it is easy to give some examples that already give you some flavour: $\mathrm{SL}_n(\mathbb{Z})$ as a lattice in $\mathrm{SL}_n(\mathbb{R})$, similarly $\mathrm{Sp}_{q}(\mathbb{Z})$ in $\mathrm{Sp}_q(\mathbb{R})$ or more elaborate constructions where you start from an algebraic number field and an algebra over that field and take some subgroup of the automorphism group of that algebra. Note that in the two cases I presented to you the lattices are not torsion-free, but you can find finite index subgroups which are torsion-free and therefore give you locally symmetric spaces.
As I said there is a fairly technical definition of an arithmetic lattice in a Lie group, and the first guess of everybody hearing of this for the first time is that this should be something exceptional - why should a "generic" lattice be constructible by number-theoretic methods? And indeed, the example of $\operatorname{SL}_2(\mathbb{R})$ supports that guess. The associated symmetric space $\operatorname{SL}_2(\mathbb{R})/\operatorname{SO}(2)$ is the hyperbolic plane $\mathbb{H}^2$. There are uncountably many lattices in $\operatorname{SL}_2(\mathbb{R})$ (with the associated locally symmetric spaces being nothing other than Riemann surfaces), but only countably many of them are arithmetic.
But in higher rank Lie groups, there is the following truly remarkable theorem known as Margulis arithmeticity:

Let $G$ be a connected semisimple Lie group with trivial centre and no compact factors, and assume that the real rank of $G$ is at least two. Then every irreducible lattice $\Gamma\subset G$ is arithmetic.

A: The http://en.wikipedia.org/wiki/Feit-Thompson_conjecture is about a diophantine equation whose non-solvability would simplify the proof of the Feit-Thompson theorem.
A: Do you count the application of prime number theory and factorization in cryptography?
A: What is your idea about a problem in number theory that says:
$\frac{p^q-1}{p-1}$ never divides $\frac{q^p-1}{q-1}$ if $p,q$ are distinct primes.
This is a $\textbf{conjecture}$ and the validity of this conjecture would simplify the proof of solvability of groups of odd order, (W. Fiet, J. G. Thompson, $\textit{Pacific J. Math.}$, 13, no.3 (1963), 775-1029), rendering unnecessary the detailed use of generators and relations.
An other interesting application of number theory is in real world. Many years ago, cables used for communication. A lot of cables must be gathered near to each other for more efficiency. But for blocking the noises of each cable to the other cable, a special arrange of cables needed. For this arrangement and neighboring of cables, scientist used reminder theorem and number theory. I think first time, Bell company's scientists invented it.
Also, I think this relation between group theory, graph theory and number theory is very nice example:
Suppose the order of group $G$, $|G|$, is $n=p_1^{k_1}p_2^{k_2}\ldots p_s^{k_s}$. We fix two prime numbers $p_i$ and $p_j$ of divisors of $n$ and define a graph $\Gamma(G)$ as fallow:
The vertices of $\Gamma(G)$ are the elements of group $G$ and two vertices $g_1$ and $g_2$ are adjacent if and only if $o(g_1g_2)=p_ip_j$, where $o$ means the order of element $g_1g_2$ as a group element.
These graphs have very nice structures and well defined as $\textit{Prime Graph}$ of group. 
A: One of the first conditional proofs of the undecidability of Hilbert's tenth problem, by Davis and Putnam in 1959, assumed the existence of arbitrarily long arithmetic progressions of primes, as well as a more technical conjecture of Julia Robinson.  The number-theoretic hypothesis was soon removed by Robinson (basically by replacing primes by almost primes), and the latter hypothesis removed by Matiyasevich, leading to his famous theorem.  So I guess this is an example of how number theory was used in the rest of mathematics.
(The existence of arbitrarily long arithmetic progressions of primes was eventually proven several decades later, although the techniques used in the proof were mostly analytical rather than number-theoretic.)
A: This is maybe too elementary --- very simple number theory is used in the classification of finite Markov Chains.
See for instance: Karlin & Taylor: A First Course in Stochastic Processes.
A: There is some interesting, recent work on the PORC conjecture (which is about Group Theory, specifically, finite $p$-groups). In some sense this is treading close to number theory even in its statement, I guess:
PORC Conjecture (Higman) Let $n$ be a fixed positive integer. The number $f(p,n)$ of nonisomorphic $p$-groups of order $p^n$ is given by a polynomial in $p$ whose coefficients depend only on the residue class of $p$ modulo some fixed $N$. 
(PORC="Polynomial On Residue Classes")
The statement itself makes reference to number theory, of course; but the recent work, by du Sautoy and Vaughan-Lee (Non-PORC behaviour of a class of descendant $p$-groups, in the arXiv) delves deep into number theory and arithmetic geometry (as does a previous paper by du Sautoy associating the problem of counting nilpotent groups with elliptic curves). 
A: To develop a point already mentioned: To some extent algebraic geometry, including complex
algebraic geometry, is a part of number theory. The reason for this is that any algebraic variety, say over $\mathbb{C}$, is defined by polynomial equations involving only finitely many coefficients, so the coefficients live in a ring which is a finitely generated $\mathbb{Z}$-algebra $A$, and $A$ belongs to the domain of number theory. For example, if $m$
is a maximal ideal of $A$, then $A/m$ is a finite field, and the intersection of all maximal ideals of $A$ is $(0)$, so studying "varieties" over $A$ can be reduced in principle to
studying varieties over finite fields. 
Applications of this method to prove results in complex algebraic geometry by means of number-theoretic methods are many. For a few, relatively elementary but still striking, examples (including the theorem of Ax-Grothendieck and the existence of a fixed point for a $p$-group acting algebraically on $\mathbb{C}^n$), see e.g. this survey paper of Serre. For a more advanced example,
consider the beautiful theorem of Batyrev, that  birational Calabi-Yau $n$-folds have equal Betti numbers, which is proved by reducing the question to a question over finite field solved using Deligne's proof of the (last) Weil's conjecture, one of the jewel of modern algebraic number theory.
A: Number theory naturally arises when analysing nonlinear partial differential equations on the torus, basically one wants to understand the extent to which nonlinear resonances between frequencies can occur, and such frequencies live on an integer lattice if the spatial domain is a torus, so one is naturally led to questions of counting lattice points in some explicit algebraic (or semi-algebraic) set, which is a problem that can often be tackled by number-theoretic methods.  For instance, the basic divisor bound in number theory - that the number of divisors of a large integer n is $O(n^{o(1)})$ - already leads to some highly useful consequences for such equations; I discuss this point briefly at http://terrytao.wordpress.com/2008/09/23/the-divisor-bound/ .
(This application of number theory is not unrelated to the use of number theory to understand small divisors in dynamics, as alluded to in other responses.)
A: Here is another example from dynamical systems. As has already been explained in some other posts, the fine structure of dynamical systems often depends on subtle number-theoretic properties of some involved constants.
Assume you have a domain $G\subseteq\mathbb{C}$ and a holomorphic map $f\colon G\to G$ with a fixed point $z\in G$, and you want to study how successive iterates of $f$ around $z$ behave. For sake of simplicity assume that $z=0$. Now locally around $0$ we can approximate $f$ by a linear function $\zeta\mapsto a\zeta$ where $a=f'(0)$, so a simple heuristic says that if we want to understand high powers of $f$, we should understand high powers of $a$. It is then quite clear that the only interesting case is $|a|=1$, so let us assume $a=\mathrm{exp}2\pi it$. Then there are some relations between the growth of the entries in the continued fraction expansion of $t$ and the behaviour of $f$ around $z=0$ under iteration.
You can read more about this in the book "Complex Dynamics in one Variable" by John Milnor. Keywords are Siegel disks and Brjuno numbers.
A: It is used in homotopy theory (topological modular/automorphic forms). Class field theory is used e.g. in this article

*

*Niko Naumann, Arithmetically defined dense subgroups of Morava stabilizer groups, Compositio Mathematica, 144(1) (2008) 247-270, doi:10.1112/S0010437X07003181, arXiv:math/0607665
Also, it is a trend in algebraic geometry to reduce geometric questions to finitely generated fields, so to the realm of arithmetic geometry.
A: I will add to Kevin Walker's and Robert Kucharczyk's responses.  I am drawing the following from a nice survey paper by Marc Lackenby, Finite covering spaces of 3-manifolds, in Proceedings of the International Congress of Mathematicians in Hyderabad, India, 2010.
There are several open questions about finite covering spaces of hyperbolic 3-manifolds, such as whether every hyperbolic 3-manifold has a finite cover that: has positive first Betti number $b_1$, admits a $\pi_1$-injective embedded surface, or fibers over the circle, for example.
Arithmetic lattices seem to be useful in achieving partial results to some of these questions because they permit the use of tools from number theory.  For example, Lackenby quotes the following results about arithmetic hyperbolic manifolds (i.e., $\mathbb{H}^3$ modulo an arithmetic lattice):

  
*
  
*Every arithmetic hyperbolic 3-manifold admits a closed orientable immersed $\pi_1$-injective surface. 
  
*Let an arithmetic hyperbolic 3-manifold $M$ have an invariant trace field $k$ and quaternion algebra $B$. If at every finite place $\nu$ where $B$ ramifies, the completion $k_\nu$ contains no quadratic extension of $\mathbb{Q}_p$ ($p$ a rational prime with $\nu$ dividng $p$), then $M$ has a finite cover with positive $b_1$.
  
*If an arithmetic hyperbolic 3-manifold $M$ has $b_1>0$, then $M$ has finite covers with arbitrarily large $b_1$.
  
*If an arithmetic hyperbolic 3-manifold $M$ contains a closed immersed totally geodesic surface, then $M$ has a finite cover which fibers over the circle.
  

One can also use number theory to construct finite covers ("congruence covers") of any hyperbolic 3-manifold through a process I do not really understand.
I understand that The Arithmetic of Hyperbolic 3-manifolds, by MacLachlan and Reid, is a good resource for the use of number theory in this subject.  You might also look at the survey I mentioned above if you want something briefer.
A: Here is a random example (in the sense that I just happened to come across it here: Order of vanishing at the cusps for the modular theta function). 
The abstract of Elkies' article (http://arxiv.org/abs/math/9906019) reads :
We use theta series and modular forms to prove that $\mathbf{Z}^n$ is the only integral unimodular lattice of rank $n$ without characteristic vectors of norm $< n$... By the work of Kronheimer and others on the Seiberg-Witten equation this yields an alternative proof of a theorem of Donaldson on the geometry of $4$-manifolds.
The paper has appeared in Math. Research Letters 2 (1995), 321--326. 
A: Julia Robinson proved that the theory of fields is undecidable by showing that the natural numbers form a subset of the rationals definable by a first-order formula in the language of fields. The construction of this formula involved an ingenious application of number theory. For an accessible account, see the article by Flath and Wagon: 


*

*Stan Wagon and Dan Flath, How to pick out the integers in the rationals: an application of number theory to logic, Amer. Math. Monthly 98 (1991), no. 9, 812–823. MR 1132996 (93b:03076) 

A: The study of mixing properties of commuting operators in Ergodic Theory leads to problems on unit equations.
A: Bourgain has a nice paper, Pointwise ergodic theorems for arithmetic sets, (subsequently extended in various directions by other authors including my co-author, Máté Wierdl) on proving a version of the Birkhoff ergodic theorem where one averages along the sequence of square numbers, rather than the sequence of integers. That is: for a measure-preserving system $T\colon X\to X$ and a (square-integrable) function $f$, one considers convergence of the averages
$$
\frac{1}{N}\sum_{j=1}^N f(T^{j^2}x).
$$
Bourgain proves using analytic number theory techniques involving exponential sums that there is convergence almost everywhere, just as in the regular Birkhoff ergodic theorem (although not to the integral as in the regular case and the convergence fails for a typical $L^1$ function, unlike the regular case).
A: I give two application from Mathematical Physics.
Quantum chaos:
The Selberg trace formula inspired the Gutzwiller trace formula. The upper half plane is often used as a toy model to understand Quantum Chaos:  www.maths.bris.ac.uk/~majm/bib/arithmetic.pdf.
Quantum field theory:
Also I have heard repeatedly that automorphic forms turn up in string theory and that there is a connection between topological and conformal quantum field theories with the geometric Langlands program.
I am not an expert, so feel free to expand and edit.
Edit by Tom Copeland (1/18/21): I'll take you up on that offer by pointing out the references by developers of the Geometric Langlands Program in the MO-Q Explaining Mukai-Fourier Transforms Physically, a program that extrapolates basic features of the Riemann zeta function--functional symmetry equation, prime factorization formula, Mellin/Fourier transform reps, and associated modular (theta) function and sl2/Lie theory relations--to delineate connections among quantum field theories. (Likewise, feel free ... .)
A: I don't know if the following application has been mentioned in this thread. The last step in the solution of Hilbert's third problem is to prove that $\arccos(1/3)/\pi$ is an irrational number. This proves that the cube and the regular tetrahedron have different Dehn invariants, hence are not congruent.
http://en.wikipedia.org/wiki/Hilbert%27s_third_problem
A: Number theory has been used to prove many interesting results on $SO(3)$ and related Lie groups, which in turn has attractive applications for the underlying symmetric spaces. A prime example is Drinfeld's solution of the Ruziewicz problem on invariant means of the sphere, or the related recent work of Bourgain-Gamburd on the spectral gap for finitely generated subgroups of $SU(2)$. Related is the Banach-Tarski paradox on doubling the ball, or the recent result of Kiss-Laczkovich that a ball can be decomposed into 22 (or more) congruent pieces.
I also regard Gödel's incompleteness theorem as an application of number theory. Some variants of it, like Matiyasevich's theorem on diophantine equations is highly number theoretic both in its statement and proof.
A: Nonlinear PDEs were mentioned above, but there is also an old example from linear PDEs (I learned about this from Boris Paneah). 
In a 1939 paper 
(link http://www.ams.org/journals/bull/1939-45-12/S0002-9904-1939-07103-6/S0002-9904-1939-07103-6.pdf)
Bourgin and Duffin study the Dirichlet problem for the wave equation on a rectangle with sides A and B. 
They show that the uniqueness of the problem depends on the ratio A/B being irrational. 
More strikingly, they show that the existence of a solution (with certain regularity) depends on how difficult it is to approximate A/B by rational numbers. 
A: I believe that has not yet been mentionned the role of quadratic forms
over integers in the classification of four manifolds (work of Freedman,
Donaldson ...). It is not an example of very "high" number theory but
it is a case where number theoretic objects "parametrize"  topological
or differential geometric objects, relation which seems unexpected at first.
A: Excerpt from "Moonshine Link Discovered for Pariah Symmetries" (2017)
Apart from their cameo role in the classification of finite symmetries, the pariahs “have not appeared anywhere in mathematics,” wrote Ken Ono, a mathematician at Emory University, in an email. “They are something like the super heavy metals in the periodic table of elements.”
Now Ono, John Duncan of Emory, and Michael Mertens of the University of Cologne in Germany have succeeded in welcoming one of the pariahs, called the O’Nan group, into the framework of a theory known as “moonshine.” Originally developed decades ago for a gargantuan symmetry structure called the monster group, moonshine forges deep connections between groups of symmetries, models of string theory and objects from number theory called modular forms.
The new work, which the researchers describe today in Nature Communications, puts the O’Nan group at the crest of this new wave of moonshine, which links certain symmetry groups to special classes of “weight 3/2” modular forms, objects that also show up in natural counting functions for black holes and for higher-dimensional generalizations of strings called “branes.”
(See the Nature article Pariah Moonshine.)
Edit: Jan 10, 2021:
In addition see the MO-Q "The Dedekind eta function in physics" in which I link to a lecture by Cheng and Felder that sketches very nicely the relationships among string theory, moonshine, J-homomorphism, and modular forms, such as the Dedekind eta function.
A: There are some very interesting examples of pointsets with pure point diffraction in Aperiodic order, coming from number theory.
The simplest example is the set of square free integers
$$
S= \{ n \in \mathbb Z: \forall p \mbox{ prime }, p^2 \nmid n \}
$$
The issue for diffraction is that for this example it matters how one averages when calculating the diffraction. It was observed in Arxiv paper that if one uses the "natural" averaging sequence $A_n=[-n,n]$ the diffraction is pure point and can be calculated explicitly. The proof is basically a long technical computation using the Chinese Remaining Theorem.
Note here that this is the diffraction of the square of the Mobius function.
In recent years this example motivated some progress in the area of Aperiodic Order, leading to a systematic study of maximal density weak model sets and $\mathcal{B}$-free systems. As a side note, the primes actually fit nicely in this picture, but their density and hence diffraction is 0, so all results about primes coming from this direction are trivial.
