In this work an efficient method is presented for the pencil beam constrained synthesis of linear sparse arrays. As a first step, the positions of a number of isotropic radiators are found on an aperture of given length. Then, the isotropic radiators are replaced with real antenna elements, and the excitations are optimized in such a way that, taking the mutual coupling into account, the radiation pattern belong to a prescribed mask. Two numerical examples show the effectiveness of the proposed approach.