Find the maximum of the value $c(n)$ (similar to Hardy's inequality) This problem has been posted on Math.SE for seven days, without a solution.

Let $n\ge 2$ be a given positive integer, and $a_{1},a_{2},\cdots,a_{n}>0$, such that $$a_{1}a_{2}\cdots a_{n}=1$$
  Find the maximum of the value of $C(n)$ satisfying
  $$\sum_{k=1}^{n}\left(\dfrac{1}{k}-\dfrac{2}{n(n+1)}\right)a_{k}\ge C(n)\left(\sum_{k=1}^{n}\dfrac{k^2}{a_{k}}\right)^{\frac{1}{n-1}}$$

This inequality is similar to Hardy's inequality on Math.SE, Various proofs of Hardy's inequality.
I have tried some methods but not solved it, such as Cauchy-Schwarz inequality or induction.
 A: At first, we denote $c_k=\frac1k-\frac2{n(n+1)}$, take $C(n)=(n-1) \biggl( \frac{2}{n(n+1)!} \biggr)^{1/(n-1)}$ as in Brendan McKay's answer, and make the inequality homogeneous: $$\sum_{k=1}^n c_k a_k\geqslant C(n) \left(\sum_{k=1}^n k^2 \prod_{j\ne k} a_j\right)^{\frac1{n-1}}.$$ 
Now we do not need the condition $\prod a_j=1$. Denote $a_k=kx_k$, using Brendan McKay's guess on where is the maximum. The inequality rewrites as
$$\sum_{k=1}^n kc_k x_k\geqslant C(n) (n!)^{\frac1{n-1}} \left(\sum_{k=1}^n k \prod_{j\ne k} x_j\right)^{\frac1{n-1}}.$$
Now we fix LHS and maximise RHS. If the maximum point is on the boundary, i.e. some $x_i$ equals 0, the inequality reduces to AM-GM for $n-1$ numbers $kc_kx_k$, $k\ne i$ (and comparing the constants - this part is quite boring and I skip it). Otherwise by Lagrange multipliers the partial derivatives of $\sum_{k=1}^n k \prod_{j\ne k} x_j$ in the maximum point should be proportional to the numbers $kc_k$. We have $$\frac{\partial}{\partial x_i} \sum_{k=1}^n k \prod_{j\ne k} x_j=P\sum_{k\ne i} \frac{k}{x_k x_i},$$
where $P=\prod_k x_k$. So we get, denoting $y_k=\frac1{x_k}$, the following proportionality relations: $\sum_{k\ne i} ky_ky_i=\lambda c_k=\lambda (1-\frac{2i}{n(n+1)})=\frac{\lambda}{n(n+1)/2}\sum_{k\ne i} k$. Now denote $M=\max y_i$, let $M=y_a$, $m=\min y_i$, let $m=y_b$. For $i=a$ we have $$\frac{\lambda}{n(n+1)/2}\sum_{k\ne a} k=\sum_{k\ne a} ky_ky_a\geqslant Mm\sum_{k\ne a} k,$$ for $i=b$ we have $$\frac{\lambda}{n(n+1)/2}\sum_{k\ne b} k=\sum_{k\ne b} ky_ky_b\leqslant Mm\sum_{k\ne b} k.$$
Therefore $\frac{\lambda}{n(n+1)/2}=Mm$ and we have equalities everywhere. For $n\geqslant 3$ it implies that all $y$'s, thus all $x$'s are equal and the equality occurs. For $n=2$ we always have the equality.
