It does NOT depend on IAS but on TAS M = TAS / a
.. respectfully suggest you might do a bit more homework. Your equation is quite correct but the normal calculation for M works on CAS and Hp, I suggest. No point using less accurate data when you have immediate inputs.
Example thread plucked out of the air is
this one.