Pipe Scaling
Pipe scaling refers to the relationship of the pipe diameters throughout a rank
 of pipes. When a rank of pipes is said to halve on the 17th note, this means
 that the 17th pipe is half the diameter of the first pipe. The equation for
 calculating the diameter of each pipe in a rank is as follows:

DIA(n) = SD / [2^((n - 1)/(HN - 1))]

    DIA(n) is the diameter of pipe number n
    SD is the starting diameter or the diameter of pipe number one
    HN is the halving number 

For example, here are the first seventeen diameters of the normal scale which
halves on the 17th note: 
 The diameters are calculated using the following equation:
DIA(n) = 155.5 / [2^((n-1)/16)]
The equation also works for wood pipes by simply replacing the diameter with
 the internal width or internal depth.

Click here for a generic Excel spreadsheet for generating a rank of pipes.