$\sum a_n (\log a_n)^{-1}$ attains a maximum under the constraint $\sum a_n n = 40$ For sequences $\{a_n\}_{n=1, \ldots}$, with $0 \leq a_n \leq 1$, let us define
$$S(\{a_n\}) = \sum_{n=1}^\infty a_n (\log a_n)^{-1}, \hspace{12pt} M(\{a_n\}) = \sum_{n=1}^\infty a_n n$$
Find an explicit expression for the maximum of $S(\{a_n\})$ under the constraint
$M(\{a_n\}) = 40$ and show that it is attained.
I've been trying Lagrange multipliers, but I haven't been able to get this to work.
 A: The Lagrange condition gives:
$$\frac{d}{da_n}\frac{a_n}{\log a_n}= \lambda n, $$
or:
$$\frac{1}{\log a_n}-\frac{1}{(\log a_n)^2} = \lambda n,\tag{1}$$
and since the $LHS$ of $(1)$ is negative it follows that $\lambda<0$ and:
$$\log a_n = \frac{1-\sqrt{1-4\lambda n}}{2\lambda n} = \frac{2}{1+\sqrt{1-4\lambda n}}.\tag{2}$$
However, this gives $a_n = 1+O\left(\frac{1}{\sqrt{n}}\right)$, and no sequence with such an asymptotic behaviour can have a bounded $M(\{a_n\})$. This suggests that the maximum, if attained, is attained on the boundary of $[0,1]^{\aleph_0}$. Since the function $f(x)=\frac{x}{\log x}$ is negative, decreasing and concave over $[0,1]$, the best choice is to take the greatest number of zero coordinates. But if we take the sequence that is everywhere zero, except for $a_N=\frac{40}{N}$ (we may assume $N\geq 40$), then the value of $S(\{a_n\})$ is just $\frac{40}{N \log\frac{40}{N}}$, that goes to zero as $N$ increases. Hence
$$\sup S(\{a_n\}) = 0,$$
but the maximum is not attained.
