Here is George Greenhill's formula for calculating the correct rate of twist for firearms, His formula is based on the rule that the twist required in calibers equals 150 divided by the length of the bullet in calibers. This can be simplified to:
Twist = 150 X D2/L
Where:
D = bullet diameter in inches
L= bullet length in inches
150 = a constant
This formula had limitations, but worked well up to and in the vicinity of about 1,800 f.p.s. For higher velocities most ballistic experts suggest substituting 180 for 150 in the formula.
This will give you a useful approximation to the desired twist. This formula was based on a bullet with a specific gravity of 10.9, which is about right for the jacketed lead core bullet. Notice that bullet weight does not directly enter into the equation. For a given caliber, the heavier the bullet the longer the bullet will be. So bullet weight affects bullet length and bullet length is used in the formula.
I'm not a mathematician so please don't ask me to explain this formula in detail