A=Speed of pokemon trying to run away.
B=Speed of opponent's pokemon, divided by four.
C=Number of times you tried to run away.
If your F value is over 255, then you will successfully run away; if it is 255 or less, then the game will generate a random number over the interval [0,255]. If the number is greater than F, then you escape. If not, then you "can't escape" and wasted a turn.