N=11·13·17^2 and M=7^3·11.

Write all factors of N in the prime factorization form.

you already did it