JBM ballistic has some info on that. Robert McCoy's book has all the details. The Excel sheet BC calculator on Lilja's (barrel maker) site, gives the twist needed to provide a 1.5 stability factor (for a given set of bullet parameters). I think it implements McCoys code.