Osculating spaces and diophantine equations (with an appendix by Pietro Corvaja and Umberto Zannier)