On the Diophantine equation (nk)=(ml)+d