A new algorithm for differential photometry: computing anoptimum artificial comparison star