Diophantine equations for classical continuous orthogonal polynomials