Translating number of millimeters into digital 3x numbers?
Simple "Point and click" digital camera measure the zoom capability as a number followed by an "X", eg 3x, 5x.
SLR cameras measure the zoom as a number of millimeters.
If I have a Nikon D40 SLR, what millimeter lens would be "4x"?
You're making a lot of incorrect assumptions here. A lens is described using mm. The longer the lens the closer your images will appear. A 50mm lens on a DSLR looks pretty much like what you see with your own eyes. A 100mm lens will make the subject of the photograph look twice as close as a 50mm lens. And a 400mm lens is almost like a telescope compared to the 50mm.
On simple cameras you might need to search to see what length the lens is, but it's there somewhere. Let's say it's 50mm. And it's a 3x zoom. This means that it's effectively 50mm-150mm.
Conversely you could say that a 24-75mm zoom on a DSLR provides 3x zoom. And if a 25mm-100mm zoom existed it would be a 4x zoom.
But if you've got a DSLR you need to stop thinking in terms like 3x and 4x. Figure out how things look through a 50mm and a 100mm and you'll have a good sense of what's going on.
The "X" number refers to how much zoom range the lens has, not to any specific focal length. So a 28-112mm zoom would be 4x, but so would a 50-200mm. The actual focal lengths for a P&S camera are very small because of the small sensor size, but are often expressed in 35mm film frame size (24x36mm) equivalents for comparison purposes.
The reason why the terms 3x or 5x is not used for DSLRs because it is a very general statement that does not tell you anything about the angle of view you're getting. That's why SLR lenses always use focal length in mm instead that will give you an exact idea of the angle of view.
4x merely means that the longest focal length is quadruple the smallest focal length, it does not tell you anything about the angle of view your getting. So for example, a lens that goes from 18-72mm would be a 4x zoom lens. However, a lens that goes from 100-400mm would also be a 4x zoom lens, but because of the difference of focal length, the effect is much much different. The lens with the longer focal length will always give you a narrower field of view.
On just about all DSLR cameras including the D40, the focal length in millimeters is printed on the lens itself. No SLR lens I know of uses 3x, 4x, etc.
As mentioned above, you seem to be stuck in P&S jargon
The ONLY reason the optical zoom range is important on a P&S camera is because you can't change the lenses. Period
dSLR's use interchangeable lenses, so you can use ANY lens you need from extreme wide angle zooms to super telephoto lenses with specialty lenses like macro, fisheye or perspective control lenses
The zoom lenses are what they are. I have two 2x zooms. One is a 12-24 mm wide angle (used for shooting landscapes or architectural) and the other is a 200-400 mm telephoto (used for shooting sports) If I were to tell you I was using a 2x lens, what would you know? Not much
You really just have to begin to understand what each focal length means in what its field fo view is and that that means to the photographer
If you really, really have to know the optical zoom range, you can divide the big number by the small number
Here is a link that will show you the relative differences between lens lengths.