For some sequence, $x_{n}=\frac{n}{\log n} \mathbb{1}_{(0,1/n)}$ (where $n= 2, 3, \dots$), find $\sup_{n}x_{n}$. In this case, we are talking about a sequence of random variables over measure space $((0,1),\mathcal{B}((0,1)),\lambda)$, where $\lambda$ is the lebesgue measure, though this part is rather unimportant.
One can show that $A=\sum_{2}^{\infty} \frac{n}{log n} \mathbb{1}_{[\frac{1}{n+1},1/n)}$ will be this supremum by showing that it satisfies $A\geq x_{n}$ and $\forall \epsilon >0, \exists n^{*}: x_{n^{*}}+\epsilon>A$. However, it is claimed that one can actually derive this form of the supremum constructively (that is, there is a way to find this supremum without necessarily testing different values for it). Is this true? If so, how?
On the interval $[\tfrac13,\tfrac12)$, we have that $x_3=x_4=\cdots=0$. So on the interval the supremum agrees with $x_2$.
On $[\tfrac14,\tfrac13)$, we have $x_4=x_5=\cdots=0$, and $x_3<x_2$ (since $\tfrac3{\log 3}<\tfrac2{\log 2}$)
On $[\tfrac15,\tfrac14)$, we have $x_5=x_6=\cdots=0$, and $x_4=x_2>x_3$
Now the pattern repeats:
So the supremum is $$ \frac2{\log 2}\,1_{[\tfrac15,\tfrac12)}+\sum_{n=5}^\infty\,\frac{n}{\log n}\,1_{[\tfrac1{n+1},\tfrac1n)} $$