TITLE: Uses of quadratic reciprocity theorem
QUESTION [46 upvotes]: I want to motivate the quadratic reciprocity theorem, which at first glance does not look too important to justify it being one of Gauss' favorites. So far I can think of two uses that are basic enough to be shown immediately when presenting the theorem:
1) With the QRT, it is immediate to give a simple, efficient algorithm (that can be done even by hand) for computing Legendre symbols.
2) In Euler's proof of Fermat's claim on the conditions in which a prime $p$ is of the form $x^2+ny^2$ (for certain small values of $n$) the proof is reduced to finding the conditions under which $p$ divides $x^2+ny^2$ for some $x,y$, hence to the question under which conditions is $-n$ a quadratic residue modulo $p$, which leads immediately to the QTR (for example, for $n=3$, where we get that $p\equiv_3 1$). I really like this example since it begins with an "historic" problem and proceeds to "discover" the QTR through special cases (which is what Euler did in practice - see Cox's book on "Primes of the form $x^2+ny^2$").
However, I am sure there are many more examples (and I'm especially curious as to how Gauss reached the theorem himself). I'd love to hear about them and receive references for further reading.

REPLY [9 votes]: The quadratic reciprocity law in any of its forms shows that there is an un-obvious correlation between different primes.  The $(p,q)$ symbol constrains the $(q,p)$ symbol.   This is astonishing compared to other more "linear" theorems about congruences or unique factorization.  In its 20th-century reformulations quadratic reciprocity is seen as an avatar of other reciprocity laws in geometry (reciprocity for tame symbols) and even geometric topology (linking numbers where knots play the role of primes) and although these other theorems are in some ways easier to prove, the analogies between all of them are mysterious.
Basically, if you are not shocked by this theorem, you don't completely understand it.   Historically it was a hard-won, prize result and not an inevitable universal discovery like the Pythagorean formula or other theorems that were difficult in their time but found independently in many times and places.  Many cultures had knowledge of basic number theoretic facts but quadratic reciprocity is one of the first signs of number theory as a science.