The little red number does mean what gear they recomend you be in for the corner, they do underestimate your driving depending on how good you are, if you suck, watch it
The number is the suggested gear for the corner. It's not always right, but it can be used as a guide. More significantly though, it starts to flash at you when you should be braking.