As already explained in the other answer, field lines are "not a fact of nature".
Indeed, the number of field lines is not a meaningful physical quantity, but only a useful tool to visualize the magnetic of electric fields. It is not a meaningful quantity because it is not measurable.
The equation you are looking for is just $$N=a |E|$$ where $N$ is the number of lines, $|E|$ is the field intensity and $a$ is a proportionality constant. The constant a is arbitrary, and you can basically decide how many lines to draw in order to make your plot/figure looking better. In this sense, they are not measurable and they are not a physical quantity, because one cannot answer unambiguously the question "How many field lines are in the point P?". The answer to this question is a matter of convention, because it depends on the constant $a$. However, the ratio between the number of field lines at two different point is equal to the ratio of the field intensity.
In summary, the number of lines is really just a useful way to visualize the field, they are not a physically well defined quantity.