Extending to n dimensions, the defining equation becomes
\( w(r) = \left( 1 - \int_0^r w(r') \, dr' \right) N \cdot n V_n r^{n-1} \)
where V

is the angular volume factor: V(1) = 1, V(2) = pi, V(3) = 4*pi/3, etc.
\( V_n = \frac{1}{n} \cdot \frac{2\pi^{n/2}}{\Gamma(n/2)} = \frac{\pi^{n/2}}{\Gamma(n/2+1)} \)
This expression gives V(1) = 2 instead of 1, but that's for extending in both directions instead of in only one direction from zero.
One can solve this equation in the same way as the others, and one finds
\( w(r) = N \cdot n V_n r^{n-1} e^{- N \cdot V_n r^n} \)
I will now try to calculate the mean and median.
The median is easy.
\( \int_r^{\infty} w(r) \, dr = e^{- N \cdot V_n r^n} \)
\( r_{median} = \left( \frac{\ln 2}{N \cdot V_n} \right)^{1/n} \)
The mean is more difficult. One must average r over the distribution:
\( r_{mean} = \int_0^{\infty} N \cdot n V_n r^n e^{- N \cdot V_n r^n} \, dr \)
Change variables from r to u:
\( r = \left( \frac{u}{N \cdot V_n} \right)^{1/n} \)
That gives us
\( r_{mean} = \left( \frac{1}{N \cdot V_n} \right)^{1/n} \int_0^{\infty} u^{1/n} e^{- u} \, du = \left( \frac{1}{N \cdot V_n} \right)^{1/n} \Gamma(1+1/n)\)