It's the square root in all cases.
2D R = sqrt(a^2+b^2)
3D R = sqrt(a^2 +b^2 + c^2)
4D R = sqrt(a^2 + b^2 +c^2 + d^2)
ND R = sqrt(a^2 + b^2 +c^2 + d^2 + .... + N^2)
The reason is because it is essential Pythagoras Theorem C^2 = A^2 + B^2, but extended into higher dimensions.
If we put that into units of metres for example, then all quantities are in square metres, and so taking the square root reduces all quantities to metres. If you take the sum of teh squares, you get an answer in square metres, but if you take the 4th root, then you reduce it to a very weird unit of metres raised to the power of one half, i.e. square-root metres, which is like an inverse area, which may be fun in maths, but has little physical meaning in the real world.
A little proof for those who wish to follow along.
Imagine that we have a rectangular box, of length a, width b, and height c and we want to find the distance, d, between opposite corners through the box, such as the image below. We can break it down into two right angle triangles, one with base a, height b and hypotenuse k, and another of base k, height c and hypotenuse d.
from [
ceemrr.com]
Thus the length of k is given by Pythagoras as
k^2 = a^2 + b+2 (Equation 1)
and length d is given by
d^2 = k^2 + c^2 (Equation 2)
We can substitute equation 2 into equation one to get
d^2 = a^2 +b^2 +c^2. (Equation 3)
This is the proof for 3D, but the argument is similar for any dimensional shape (4D, 5D up to nD), and so the general equation is
d^2 = (x1^2 + x2^2 +x3^2 +x4^2 +...+ xn^2) (Equation 4)
where the number after the x labels a particular dimension (1st, 2nd, 3rd, 4th, etc up to nth), with the magnitude of d obtained by taking the square root Equation 4 above (i.e. d is the square root of the sums of the squares up to the nth dimension).
Jonny