Give an example of a bounded, non-convergent real sequence $(a_n)$ s.t. $a_n-a_{n-1}\rightarrow 0$

This question already has an answer here:

  • Bounded sequence which is not convergent, but differences of consecutive terms converge to zero

    2 answers

Solutions Collecting From Web of "Give an example of a bounded, non-convergent real sequence $(a_n)$ s.t. $a_n-a_{n-1}\rightarrow 0$"

You can verify that $a_n=\sin\ln n$ does what you want.

How did I find that example?
The sine makes sure that the values remain bounded in $[-1,1]$.
The logarithm grows unbounded so that the sequence will keep wandering between $-1$ and $+1$ (and not stay near one value).
The growth of the logarithm gets slower and slower for larger $n$, which keeps $a_n-a_{n-1}$ small (note that $|a_n-a_{n+1}|= \frac d{dx}\sin\ln x=\frac1x\cos\ln x$ for some $x\in(n-1,n)$, hence $|a_n-a_{n+1}| <\frac1{n-1}$).

Try $a_n=\sin(\log n)$ for every $n\geqslant1$. Or $a_n=\sin(\sqrt{n})$. Or $a_n=\sin(b_n)$ for any sequence $(b_n)$ such that $b_n\to\infty$ and $|b_{n+1}-b_{n}|\to0$.