Also, I know it's a little beyond the scope of your question, but there is also the concept of the "effective M". M is calculated as shown above when you generally have 9-10 people at the table. I'll usually go down to 8 as well (since PS starts with 9 in most cases). But under 8, effective M comes into play because the blinds and antes come around faster/more often. If you are at a 10 seat table with only 6 players seated, then the formula simply becomes: (Stack / (BB + SB + (#players*Ante))) * (#seated/#seats). Once you find your effective M, you use the same chart as above as your guide.
I like examples:
Stack = $1500
Players = 6 of 10 seats
Blinds = $10/$20
Antes = 0
M = (1500/(20+10+(6*0))) * (6/10) = (1500/30)*0.6 = 50(.6) = 30
Stack = $6000
Players = 3 of 10 seats
Blinds = $200/$400
Antes = 50
M = (6000/(400+200+(3*50))) * (3/10) = (6000/750)*0.3 = 8(.3) = 2.4
See the huge difference in the second one? Instead of M=8, effective M is 2.4 which then means red zone instead of orange zone.
EDIT: oh, as a simple rule, when calculating effective M, just use 10 seats at the table anyway because calculating x/10 on the fly is easier than x/9.