Dependence of the oxygen isotope effect upon hole density in Bi2Sr2Ca1−xYxCu2O8+δ and Y1−xCaxBa2Cu4O8