What does n mean in this formula: n = pow(2, zoom)? I using this when I calculate tiles.
'n' is almost always used to denote the number of items in a dataset (ie the number of people who participated in a survey or the number of animals counted). I would venture to guess that in this case it represents the number of tiles present at a given zoom level.
However, without more information about precisely what you are trying to accomplish it is difficult to be more specific or accurate.
As already said in other answers, it seems that the equation gives an estimation of the number of tiles for each zoom level. But there is, in my opinion, an important issue.
The equation is valid in scenarios where the set of map resolutions match the sequence R, R/2, R/4, R/8..., where R is the map resolution corresponding to the zoom level 0. While this scenario is the most common, it is not the only possible. A sequence of map resolutions like R, R/3, R/9, R/27... would be possible, or even any set of numbers sorted in descending order.
In any of these two scenarios the mentioned equation is not valid.
n shows, how many tiles are in one edge of tileset for given zoom level. Tiles can be addressed by x/y/z "coordinates". n-1 is maximum value of x and y in that zoomlevel.
Probably it's simpler to explain by example:
Total count of tiles in given zoom level is pow(2, zoom*2)
In zoom level 0, there are 1*1 tiles (n=1)
In zoom level 1, there are 2*2 tiles (n=2)
In zoom level 2, there are 4*4 tiles (n=4)