The division of the chromatic scale in $7$ natural notes (white keys in a piano) and $5$ accidental ones (black) seems a bit arbitrary to me.
Apparently, adjacent notes in a piano (including white...
$\begingroup$ The first thing you have to understand is that notes are not uniquely defined. Everything depends on what tuning you use. I'll assume we're talking about equal temperament here. In equal temperament, a half-step is the same as a frequency ratio of $\sqrt[12]{2}$; that way, twelve half-steps makes up an octave. Why twelve? At the end of the day, what we want out of our musical frequencies are nice ratios of small integers. For example, a perfect fifth is supposed to correspond to a frequency ratio of $3 : 2$, or $1.5 : 1$, but in equal temperament it doesn't; instead, it corresponds to a ratio of $2^{ \frac{7}{12} } : 1 \approx 1.498 : 1$. As you can see, this is not a fifth; however, it is quite close. Similarly, a perfect fourth is supposed to correspond to a frequency ratio of $4 : 3$, or $1.333... : 1$, but in equal temperament it corresponds to a ratio of $2^{ \frac{5}{12} } : 1 \approx 1.335 : 1$. Again, this is not a perfect fourth, but is quite close. And so on. What's going on here is a massively convenient mathematical coincidence: several of the powers of $\sqrt[12]{2}$ happen to be good approximations to ratios of small integers, and there are enough of these to play Western music. Here's how this coincidence works. You get the white keys from $C$ using (part of) the circle of fifths. Start with $C$ and go up a fifth to get $G$, then $D$, then $A$, then $E$, then $B$. Then go down a fifth to get $F$. These are the "neighbors" of $C$ in the circle of fifths. You get the black keys from here using the rest of the circle of fifths. After you've gone up a "perfect" perfect fifth twelve times, you get a frequency ratio of $3^{12} : 2^{12} \approx 129.7 : 1$.…