Length of Hilbert Curve in 3 Dimensions The Hilbert Curve is a continuous space filling curve. The length of the $n^{th}$ iteration in two dimensions can be calculated by $2^n-\frac{1}{2^n}$. The curve can be generalized to fill volumes; what is the length of the $n^{th}$ iteration of the Hilbert Curve in three dimensions?
 A: Here is a screenshot of part of the first page of Hilbert's 1891 paper defining his curve:

At the $n^{\text{th}}$ level, we see that the square is broken into $4^n$ subsquares and the polygonal approximation to the ultimate space-filling curve consists of $4^n-1$ segments of length $1/2^n$. Thus, the length of the approximating curve at stage $n$ is $(4^n-1)/2^n$.
This same approach can be used to find the length of the three-dimensional version.  For concreteness, the approximations might looks something like so:

At level $n$, the cube is now partitioned into $8^n$ sub-cubes and the path consists of $8^n-1$ segments of length $1/2^n$ leading to a length of $(8^n-1)/2^n$. Note that this computation agrees with the expression reached in one of the comments to the OP empirically.
A: In $2$ dimensions the square is divided into $2^n$ by $2^n$ smaller squares ($n$ is the iteration). The majority of squares contain $2$ lines of length $1/2^n$ except for two, giving us $2(2^n * 2^n -1)/2^n$. 
In 3 dimensions there is still $2$ lines in the majority of cubes so wee need only adjust things to account for the $3$rd axis, giving $2(2^n \cdot 2^n \cdot 2^n -1)/2^n$. 
In general we have $2(2^dn-1)/2^n$, where $d$ stands for the number of dimensions.
