This article is from the Water for coffee FAQ, by Jim Schulman with numerous contributions by others.
Whether and how much scale precipitates depends on the water's
alkalinity, hardness, temperature, and total dissolved solids. These
factors together define a quantity called pH at saturation, or pHs.
pHs indicates the pH level at which the measured calcium/magnesium
bicarbonate level is at equilibrium saturation. If the pHs exceeds the
water's actual pH, no scale will form, in fact, existing scales will
tend to dissolve into the water. This is how the hardness gets there
in the first place, and why descalers are acids. If the pHs is less
than the actual pH, lime will precipitate out of the water until the
pH balance is restored.
The formula for pHs is as follows: The logs are base 10, T is
temperature in centigrade, S is mg/l total dissolved solids, H is mg/l
hardness, and A is mg/l alkalinity, both stated in CaCO3 equivalent
pHs = 44.15 + log(S)/10 - 13.12*log(T + 273) - log(H) - log(A)
The quantity pH - pHs is called the Langelier Index or LI (sometimes
called the Saturation Index or SI). A negative LI means no scaling, a
positive one means scale will form. The LI formula is:
LI = pH + 13.12*log(T + 273) + log(H) + log(A) - log(S)/10 - 44.15