The equations of betatron oscillations in nonlinear magnetic fields belong to the Lyapunov systems having a number of periodic solutions. Using the matrix methods developed for studying periodic linear systems one can construct the algorithm for searching these solutions and studying their stability in order to determined the region of stable motion. The present note describes the method of numeric search for the periodic solutions of two-dimensional betatron motion, using the nonlinear element in thin-lens approximation. To illustrate the technique, the results on calculating the pattern on the phase plane close to the line and node of the sum third-order resonance are presented. 5 refs.; 5 figs.