The prime factorization of 170,775 is 3×3×3×5×5×11×23.
The prime factorization of 315 is 3×3×5×7.
The problem seeks to find how long it will take before Planets D and E return to the same relative alignment that they have today. In essence, they are asking what is the least common multiple of their orbit times.
To find that value, collect all of the factors in both numbers, one from each set if a factor is in both sets, and multiply these factors. As one check, both original numbers should divide evenly into the product.
So we have 3×3×3×5×5×7×11×23 = 1,195,425 days.