The Prouhet–Tarry–Escott problem, indecomposability of polynomials and Diophantine equations