When lenses are close together, their diopters add. Diopters are $m^{-1}$, the inverse of the focal length. So, when I wanted glasses for bench work, typical distance 50 cm, I asked my optometrist to write me a prescription for 2 diopters more than my distance prescription. They work great!
So, toTo bring the focus from infinity to 40 cm, add 2.5 diopters to whatever focuses on infinity.