Analytic solutions of the scattering by two multilayered dielectric spheres