Where the numbers come from
Pianos are usually tuned so the A above middle C is 440 Hz. Each key up is the twelfth root of two higher, about 6 percent. Twelve keys up, the frequency doubles: A5 is 880 Hz.
Reading the note names
The number after the letter is the octave. Middle C is C4, and each new octave starts on C. So the B just below middle C is B3, not B4.