$\max(a,b)=\frac{a+b+|a-b|}{2}$ generalization

Solution 1:

Symmetrizing in the obvious way:

$$\frac{a+b+c}3+\frac{|a-b|+|b-c|+|a-c|}{12}+\\\frac{|a+b-2c+|a-b||+|a+c-2b+|a-c||+|b+c-2a+|b-c||}{12}$$

For four variables, I found:

$$\tfrac14\left(a+b+c+d+|a-b|+|c-d|+|a+b-c-d+|a-b|-|c-d||\right)$$

Of course you don't have to use absolute value signs: $$\lim_{m\to\infty}\sqrt[m]{a^m+b^m+c^m}$$