For each point c in the complex plane, iterate the rule:
z(0) = 0; for k>0: z(k) = z(k-1)^n + c
and color only the points which remain bounded, i.e. |z| is less than M within N iterations.
Warning: it may be slow at high L or N.