I have a crazy theory on how this game might determine when to crash.
The formula I have come up with is:
-(0.5)x^3 - 2.5x + 24 = Events Before Crash
Where X is the amount of gym badges the player has.
This lines up with my test of 21 events before crashing after 1 badge and numerous reports of 24 events before crashing reported numerous times.
This also lines up with the 3 events reported by many players after defeating Whitney.
If someone could test this as to whether or not 15 events is correct for a player after 2 gym badges,
then maybe these numbers could help those who are delving into the hex decimals.
That or everything I just wrote is garbage