  The problem of determination of the maximum of second harmonic generation in
the potential well containing a rectangular barrier is considered. It is shown
that, in general, the problem of finding the ensemble of structures with
equidistant first three levels has two types of solutions.
  For the first type the second and third energy levels are located above a
rectangular barrier, and for the second type the third level is located above
the barrier only. It is also shown, that generation corresponding to the second
type of solution always is less than generation for the first one. Taking into
account the effective mass changes the problem of finding the generation
maximum for a finite depth well is exactly solved.
