In this letter, we investigate the deterministic pilot allocation for sparse channel estimation in OFDM systems. Based on the rule of minimizing the coherence of the DFT submatrix, we derive that the pilot design according to the cyclic different set (CDS) is optimal. However, the CDS only exists for some specific number of OFDM subcarriers. For those cases where the CDS is unavailable, we propose a scheme using discrete stochastic approximation to obtain a near-optimal pilot pattern. Simulation results demonstrate that our scheme is much faster convergent and more efficient than the exhaustive search; and it has been shown that substantial improvement for channel estimation can be achieved.