A central problem in signal processing and communications is to design signals that are compact both in time and frequency. The variance is believed to be a good measure of compactness, and with this definition Heisenberg stated that a given function cannot be arbitrarily compact in time and frequency, defining an "uncertainty" lower bound. In continuous-time, gaussian functions reach this bound. For sequences, this is not true; it is known that Heisenberg's bound is generally unachievable. For a chosen frequency variance, we formulate the search for maximally compact sequences as an exactly and efficiently solved optimization problem, thus providing a sharp uncertainty principle for sequences.