I've been looking around for this information too! I finally found the answer (after stumbling across your question first) at this website.
According to that page, the formula is:
OD = -log T
SN = 1 + (7/3) OD
where T = transmission rate, OD = optical density, and SN = shade number.
For example, shade #10 gives SN = 10, OD = 27/7, and T = 0.000139, or nearly 13 stops! (calculating stops merely involves using base 2 instead of base 10 for the optical density. A quick and easy method is simply to divide the OD by log 2. Actually, that simplifies the formula you seek to: F = (1 / log 2) * (3/7) * (SN - 1) ...combining the constant terms gives the approximate (and much simpler) equation of:
F = 1.4 * (SN - 1)
where F = number of equivalent f-stops!
Thus, if you wanted, say, 10 f-stops, then F = 10, giving SN = 8.)
It was surprisingly difficult to find this information online! It seems that most welding companies would rather tell you what shade number you need for specific applications rather than the actual formula they used to determine that shade number...
To clarify the math, the reverse of the top equations is:
T = 10 ^ ( -(3/7)*(SN-1) )
and since 1 f-stop is half as much transmission:
F = log T / log 0.5