How to determine the maximums of certain cyclic sums?

This was asked but never answered at MSE, where it has a second open bounty.

Given fixed positive integers $n,k$, determine the minimal constant $\lambda = \lambda(n,k)$ for which the following inequality holds for any $a_1,a_2,...,a_n>0$ (taking indices mod $n$ if required): $$\sum_{i=1}^n\frac{a_i}{\sqrt{a_i^2+a_{i+1}^2+...+a_{i+k}^2}}\le \lambda$$

It seems that $\lambda=\dfrac{n}{\sqrt{k+1}}??$

I have seen for $n=3, k=1$, it is a classical inequality; see https://math.stackexchange.com/questions/1481348/prove-inequality-sqrt-frac2aba-sqrt-frac2bcb-sqrt-frac2c.

Now I have solve when $n=3,4$ case:

When $n=4, k=2$ it is also a classical inequality $$\sum_{cyc}\sqrt{\dfrac{a}{a+b+c}}\le\dfrac{4}{\sqrt{3}}$$  When $n=4,k=1$ it is also a classical inequality For $n=4,k=3$,it is clear $$\sum_{cyc}\sqrt{\dfrac{a}{a+b+c+d}}\le 2$$ Because WLOG $a+b+c+d=1$,then use Cauchy-Schwarz inequality $$\sqrt{a}+\sqrt{b}+\sqrt{c}+\sqrt{d}\le \sqrt{4(a+b+c+d)}=2$$ But general How to solve it? Thanks

• But in Vasc's inequality we have monotonicity assumption, yes? – Fedor Petrov Jan 27 '18 at 13:54
• No,This inequality for any postive real numbers also hold,because see this proof at the last ,we only WLOG $d=\max{(a,b,c,d)}$ – function sug Jan 27 '18 at 14:09
• We use the sign of $c-a$, do not we? – Fedor Petrov Jan 27 '18 at 15:27

Not always. If $a_i=t^i$ for very small $t$, this expression tends to $n-k$, this is greater than $n/\sqrt{k+1}$ for large $n$ and fixed $k$.
• so this answer maybe is $n-k$ or $\dfrac{n}{\sqrt{k+1}}$?if is right ,Now How to prove it? – function sug Jan 27 '18 at 12:15
It seems to me possible that the answer could be the maximum of $n-k$ and $\frac{n}{\sqrt{k+1}}.$ However, if not, I do not think that it is a phase transition issue.
One can get $\frac{n}{\sqrt{k+1}}.$ by making all the $a_i$ equal and get arbitrarily close to $n-k$ by making all the $\frac{a_{j}}{a_i}$ (for $j \gt i$) sufficiently small. Both of these can be achieved by letting $a_i=t^{i-1}$ for $t \in(0,1]$ in which case those (seem that they must be) the two local maxima. Here are the cases $(n,k)=(6,3)$ and $(n,k)=(7,3)$ Of course, as mentioned above, the limit of $n-k$ can be approached in other ways.
So it would seem that one can assume that all the $a_i$ are positive and that for some extremely small $\epsilon \gt 0$ each $\frac{\min{(a_i,a_j)}}{\max{(a_i,a_j)}}$ is either $1$ or less than $\epsilon.$ If so, it remains to decide if there are any times it is worth not having the $a_i$ monitonically decreasing.