It is proposed to use an iterative algorithm based on a ring spectrum and a lens to calculate a diffraction-free beam with a given transverse intensity distribution. In this work, we calculated and studied diffractive optical elements (DOEs) that form some primitive non-diffraction distributions (for example, a square and a triangle, as well as more complex grayscale distributions). It is shown that the iterative algorithm is stagnating, i.e. the number of iterations is directly related to the root mean square error. The mean square deviation of the formed transverse intensity distribution from the given primitive does not exceed 0.006 for a triangle primitive, 0.015 for a square primitive, and 0.07 for a high-contrast halftone image.