We divide the set A={0,1,2}n into: A=A0∪A1∪⋯∪A2n, where
Ak={β=(i1,i2,…,in)∈A:i1+i2+⋯+in=k},k=0,1,…,2n.
Let ak denote the number of elements in Ak. Then
(1+t+t2)n=a0+a1t+⋯+antn+⋯+a2nt2n,a2n−k=ak.
Set X=(x1,…,xn) and y=(x1+⋯+xn)/n. Then f(X)=∑k=02n∑β∈Ak∣β⋅X−1∣. Removing the absolute value signs and summing them in groups, we consider
Bk=β∈Ak∑(β⋅X−1)=nk∣Ak∣(x1+⋯+xn)−∣Ak∣=kaky−ak.
We estimate ∑k=02n∣Bk∣, by canceling appropriate terms. Consider the sizes of kak and note that
k=0∑2nkaktk−1=dtd[(1+t+t2)n]=n(1+2t)(1+t+t2)n−1
and that the coefficients of (1+t+t2)n−1=∑k=02n−2cktk (c0,c1,…,cn−1,…,c2n−2) is palindromic. Since kak=ck−1+2ck−2, we have
(n+1)an+1≥nan≥(n+2)an+2≥(n−1)an−1≥(n+3)an+3≥⋯≥2a2≥2na2n≥1a1.
This shows that U1:=∑k=0nkak<∑k=n+12nkak and U2:=∑k=n+22nkak<∑k=0n+1kak. Choose λ=(n+1)an+1U1−U2∈(−1,1), we have
f(X)≥k=0∑2n∣Bk∣≥[k=0∑n(−Bk)+λBn+1+k=n+2∑2nBk]+(1−∣λ∣)∣Bn+1∣.
The coefficient of y in the above square bracket is −U1+λ(n+1)an+1+U2=0. So the expression in the square bracket is a constant C=∑k=0nak−λan+1+∑k=n+22nak. Therefore, f(X)≥C is always true, and when x1=⋯=xn=n+11, the equality holds. Moreover, the equality holds precisely when an+1 terms in the formula above are all zero, i.e. the inner product of X=(x1,…,xn) with an arbitrary vector in An+1 is 1. The only such X is when x1=⋯=xn=n+11.