I have a function
$$F(n,S_T) = n^2 \mathbb{1}_{\frac{1}{n+1}<S_T<\frac{1}{n}} + \frac{1}{n^2}\mathbb{1}_{S_T\ge \frac{1}{n}}$$
(where $S_T>0$) and I'm asked to compute the sum
$$F(S_T) = \sum_{n=1}^{\infty} F(n,S_T) = \sum_{n=1}^{\infty} n^2 \mathbb{1}_{\frac{1}{n+1}<S_T<\frac{1}{n}} + \frac{1}{n^2}\mathbb{1}_{S_T\ge \frac{1}{n}}$$
Can you help me to solve it? By eye it seems to diverge (at least the first term) but I'm not completely sure. Thanks.
The condition $\frac{1}{n+1}<S_T<\frac{1}{n}$ can be rearranged to $\frac{1}{S_T}-1<n<\frac{1}{S_T}$. Assuming that $\frac{1}{S_T}$ is not itself an integer, then $k=\lfloor\frac{1}{S_r}\rfloor$ is the only integer in this interval.
The sum $$\sum_{n=1}^{\infty} n^2 \mathbb{1}_{\frac{1}{n+1}<S_T<\frac{1}{n}} + \frac{1}{n^2}\mathbb{1}_{S_T\ge \frac{1}{n}}$$ can then be written as $$k^2 + \sum_{n=k+1}^{\infty} \frac{1}{n^2}$$
Given the well known infinite sum $$\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}$$
your sum becomes the finite sum $$k^2 + \sum_{n=k+1}^{\infty} \frac{1}{n^2} = k^2 + \frac{\pi^2}{6} - \sum_{n=1}^{k} \frac{1}{n^2} $$
If $\frac{1}{S_T}$ is an integer then you get the same without the first $k^2$ term, and the sum goes up to $k-1$.