Using an exhaustive database on academic publications in mathematics, we study the patterns of productivity by world mathematicians over the period 1984-2006. We uncover some surprising facts, such as the absence of age related decline in productivity and the relative symmetry of international movements, rejecting the presumption of a massive ”brain drain” towards the U.S. Looking at the U.S. academic market in mathematics, we analyze the determinants of success by top departments. In conformity with recent studies in other fields, we find that selection effects are much stronger than local interaction effects: the best departments are most successful in hiring the most promising mathematicians, but not necessarily at stimulating positive externalities among them. Finally we analyze the impact of career choices by mathematicians: mobility almost always pays, but early specialization does not.