Already in the elementary school, on the chemistry classes, students are told that the general formula of alkanes is $C_nH_{2n+2}$. No proof of this claim is offered, either then or at any higher level. We now show how this formula can be proven in a mathematically satisfactory manner. To do this we have to establish a number of elementary properties of the mathematical objects called trees.