That formula has been published and repeated for many years but, as Zang suggested, it doesn't seem to apply to photographic lenses in actual use. Might be part of a famous theoretical argument in optics/physics?
This is a very general formula, the more of the lens mm the less accuracy to infinity
Physics is applied to any lens no mater is a macro, tele or anything else
Moon is a safe object for infinity focus unless you have a super tele or telescope
There is a simple way for dyi-ers to make an in-house infinity focus system
Find a binocular objective lens let’s say 500 mm and position a low light source in the exact position of 500 mm ( like a reverse telescope )
If you go to the opposite side of the light source you need infinity focus to see clearly the light source
This is because the light beams are parallel as the source is on infinity