Solving a set of coupled stochastic integro-differential equations involved in the problem with all initial conditions, we achieve analytical formulae for the complex probability amplitudes of n-photon states. In particular, evolution of the system generates maximally entangled states as so-called Bell-like states. | Generation of maximally entangled states by a Kerr-like nonlinear coupler interacting with external fields