  We discuss Linnik's work on the distribution of integral solutions to
$x^2+y^2+z^2 =d$, as $d$ goes to infinity. We give an exposition of Linnik's
ergodic method; indeed, by using large-deviation results for random walks on
expander graphs, we establish a refinement of his equidistribution theorem. We
discuss the connection of these ideas with modern developments (ergodic theory
on homogeneous spaces, $L$-functions).
