Calculating the THD knowing the voltages of the harmonics.

The formula to calculate the THD of a system when the voltages of the first few harmonics are known, is this:
Code:
THD = [ square_root(V2^2 + V3^2 + V4^2 + V5^2 + .....) ] /V1
Where:
a) THD is the harmonic distortion
b) V2, V3, V4, ... are the harmonics voltages starting from the second harmonic
c) V1 is the fundamental voltage.
 
And to be complete:

The "voltages" mentioned can either be amplitudes or rms values, so as they are consistent for all harmonics...

Also "the first few harmonics are known" is rather vague - normally THD uses all the harmonics upto an upper limit frequency (sometimes 80kHz).