EN
Let ${P_k}$ be any sequence of classical orthogonal polynomials. Further, let f be a function satisfying a linear differential equation with polynomial coefficients. We give an algorithm to construct, in a compact form, a recurrence relation satisfied by the coefficients $a_k$ in $f = ∑_{k}a_kP_k$. A systematic use of the basic properties (including some nonstandard ones) of the polynomials ${P_k}$ results in obtaining a low order of the recurrence.