Solution for counting atmospheric layers of planets according to relational data
While the question is rather hard to follow, the formula simply doesn't work.

For Mercury the formula using a naive application of the numbers predicts:
four layers

Orbital Velocity (km/s)        47.4
Density (kg/m3)              5427
Orbital Inclination (degrees)   5.1
n                            -328.65368
Aphelion (10**6 km)            69.8
Layers                          4


That is clearly not true, since Mercury has no atmosphere. You can vary the formula, by choosing different units, or taking the inclination relative to a different plane, but no matter what I try, can't get the formula to give a sensible value for all the planets. 

The formula is inconsistent, since you generally can't add velocity (km/s) to sqrt(density)*inclination (kg^0.5 degrees/m^(1.5)) as these quantities have different units. It rarely makes sense to add quantities with different units.

There is, moreover, no reason to suppose that the orbital characteristics of a planet, and its density would have any effect on the number of layers in the atmosphere, which is not a very well defined quantity anyway.

Sorry but this formula is entirely wrong.