Fractal Dimension for Menger Sponge in Higher Dimensions I am trying to find the formula for the fractal dimension of a D-dimensional menger sponge. The fractal dimension,$F$, is defined to be: 
$$ F=\lim_{\epsilon \rightarrow 0} \frac{\log(N(\epsilon))}{\log\left(\frac{1}{\epsilon}\right)}, $$
where $N(\epsilon)$ is the number of hypercubes of length $\epsilon$ needed to cover the menger sponge. I know the denominator will always be $N \log(3)$ where $N$ indicates the $N^{th}$ iteration since the size of the subcubes decrease in length by a factor of $\frac{1}{3}$ at each iteration. (In doing so, I take the limit as $N \rightarrow \infty$ rather than $\epsilon \rightarrow \infty$, see below). However, I am unsure of how to evaluate the numerator. I know the numerator should be something along the lines of: 
Number of subcubes of length $\left(\frac{1}{3}\right)^N$-Number of subcubes of length $\left(\frac{1}{3}\right)^N$ removed. 
I know for $D$-dimensions, the first term should be $3^D$. Furthermore, I know for $D=3$, the second term should be 7 and for $D=2$, the second term should be 1. However, I am not sure how to create a formula for general D for the second term. Currently, I have
$$ F = \lim_{N \rightarrow \infty} \frac{\log(3^D-\text{Number of subcubes of length } \left(\frac{1}{3}\right)^N\text{ removed}}{\log\left(\frac{1}{3}\right)^N}.$$
I just need help defining the 2nd term in the numerator in terms of $D$. Thank you!
Here is a reference to the Menger sponge that I am considering: http://www.wahl.org/fe/HTML_version/link/FE4W/c4.htm
 A: Two things you need to take care of:
In your definition of the $D$-dim merger sponge, I would assume you remove one hypercube out of every $D-1$-dim face of the $D$-dim cube, and you remove the one central cube.
For $D=3$ I agree you remove 7, 1 in each $2$-dim face and 1 in the center. For $D=2$ hovever I would remove 5, 1 in each $1$-dim face and 1 in the center.
You need to be clear if you remove cubes out of $D-1$-dim faces or out of $2$-dim faces of the $D$-dim cube.
I would go for the former, your solution (remove 1 cube for $D=2$) suggests the latter. 
In the case of removing cubes out of $D-1$-dim faces, you remove $2D+1$ faces. This sponge is thus self similar, consisting of $3^D-2D-1$ copies of itself scaled with a factor $1/3$.
Secondly, for these self similar sets you have an easier way to calculate their dimension. It's "log of copies divided by log of inverse scaling factor". Thus we have here
$$F(D) = \frac{\ln(3^D-2D-1)}{\ln(3)}.$$
If you have a slightly different definition of the sponge, i.e. remove different cubes, just count the self-similar copies and adjust this formula.
