A potential showstopper for reciprocity-based beamforming is that the uplink SNR often is much smaller than the downlink SNR, making it hard to estimate channels on the uplink. We analyze this problem by considering a "grid-of-beams world" with a finite number of possible channel realizations. We assume that the terminal can accurately detect the channel and we propose a method of improving the channel detection from uplink pilots by designing a mapping between the channel and the pilots. We find a simple metric that is to be minimized to maximize performance. Further, we propose an algorithm that draws pilot sequences from a distribution aimed to minimize the metric. We see that we can come close to optimal performance, which requires long sequences, with significantly shorter sequences.