Oxygen-enhanced atomic chain formation