Hard inequality problem (if $(a_2-a_1)^2 + (a_3-a_2)^2 + \ldots + (a_{2n}-a_{2n-1})^2 = 1$ ...) I have a hard problem :

If $$(a_2-a_1)^2 + (a_3-a_2)^2 + \ldots + (a_{2n}-a_{2n-1})^2 = 1$$ where $a_1,a_2...,a_{2n} \in \mathbb{R}$
What is the maximum of $$(a_{n+1}+a_{n+2}+…+a_{2n})−(a_1+a_2+…+a_n)?$$

I found that : $$1 \leq \sqrt{(a_1)^2+(a_2)^2 +...+ (a_{2n-1})^2} + \sqrt{(a_2)^2+(a_3)^2 +...+ (a_{2n})^2} $$
therefore : $$1 \leq (a_1)^2+(a_2)^2 +...+ (a_{2n-1})^2 + (a_2)^2+(a_3)^2 +...+ (a_{2n})^2 + 2\sqrt{\bigg((a_2)^2+(a_3)^2 +...+ (a_{2n})^2\bigg) \times \bigg((a_1)^2+(a_2)^2 +...+ (a_{2n-1})^2\bigg)}$$
Here we can use AM-GM but...
 A: Following  achille hui's suggestion: Let
$$s_k = a_k - a_{k-1}, \qquad k \ge 2  $$
with $\sum\limits_{k=2}^{2n} s_{k}^2 = 1$. Now the target function is
$$
f = (a_{n+1}+a_{n+2}+…+a_{2n})−(a_1+a_2+…+a_n)  \\
= (a_{n+2}+…+a_{2n})−(a_1+a_2+…+a_{n-1}) +a_{n+1} - a_{n} \\
= (a_{n+2}+…+a_{2n})−(a_1+a_2+…+a_{n-1}) +s_{n+1} \\
= (a_{n+3}+…+a_{2n})−(a_1+a_2+…+a_{n-2}) +s_{n+1} + a_{n+2} - a_{n-1}\\
= (a_{n+3}+…+a_{2n})−(a_1+a_2+…+a_{n-2}) +s_{n+1} + a_{n+2} - a_{n+1} +a_{n+1} - a_{n} + a_{n} - a_{n-1}\\
= (a_{n+3}+…+a_{2n})−(a_1+a_2+…+a_{n-2}) +s_{n+1} + (s_{n+2}  +s_{n+1}  + s_{n} )
$$
Continuing with that telescoping gives 
$$
f = s_{n+1} + (s_{n+2}  +s_{n+1}  + s_{n}) +  (s_{n+3}  +s_{n+2}  +s_{n+1}  + s_{n}+ s_{n-1}) + \cdots + (\sum\limits_{k=2}^{2n} s_{k} )\\
= n s_{n +1} + \sum\limits_{k=1}^{n-1} k (s_{2n +1-k} + s_{k+1} )
$$
again  with $\sum\limits_{k=1}^{2n-1} s_{k+1}^2 = 1$.
Now by the Cauchy-Schwarz inequality, 
$$
f^2 =  (n s_{n +1} + \sum\limits_{k=1}^{n-1} k (s_{2n +1-k} + s_{k+1} ))^2\\
\le  (n^2 +  2 \sum\limits_{k=1}^{n-1} k^2 ) (s_{n +1}^2 + \sum\limits_{k=1}^{n-1} (s_{2n +1-k}^2 + s_{k+1}^2 )) \\
= 
 \frac{n  (2 n^2 + 1)}{3}  (\sum\limits_{k=1}^{2n-1} s_{k+1}^2 ) 
$$
Hence $$f \le \sqrt{\frac{n  (2 n^2 + 1)}{3}}$$
This is indeed the maximum, as the Cauchy-Schwarz inequality is tight. Equality occurs when $c\cdot k = s_{2n +1-k} = s_{k+1}$ ($k = 1\cdots n$) with the constant $c$ given by the condition $\sum\limits_{k=1}^{2n-1} s_{k+1}^2 = 1$, i.e. $s_{2n +1-k} = s_{k+1} = k/ \sqrt{\frac{n  (2 n^2 + 1)}{3}}$ (for $k = 1\cdots n$). 
Just for getting a feeling, we can check that for the first two $n$.
For $n=1$, we have the obvious $s_2 = 1/ \sqrt{\frac{n  (2 n^2 + 1)}{3}} = 1$. The $a_k$ can be recomputed from this: Fix some $a_1$ and let $a_2 = a_1 + 1$.
For $n=2$, we have $\sqrt{\frac{n  (2 n^2 + 1)}{3}}  = \sqrt{6}$, hence $s_2  = s_4 = 1/\sqrt{6}$ and  $s_3  = 2/\sqrt{6}$. Indeed, $s_2^2 + s_3^2 + s_4^2 = 1$ and $f = s_2 + 2 s_3 + s_4 =  6/\sqrt{6} = \sqrt{6}$. Again, the $a_k$ can be recomputed from this: Fix some $a_1$ and let $a_2 = a_1 + 1/\sqrt{6}$, $a_3 = a_1 + 3/\sqrt{6}$, $a_4 = a_1 + 4/\sqrt{6}$. Then $f = (a_3 + a_4) - (a_1 +a_2) = 7/\sqrt{6} - 1/\sqrt{6} = \sqrt{6} $.
