How to add a unique number for each reiteration and render it multiple times?
Set it as a variable inside your loop and you can reuse it all you want.

 {% for entry in craft.entries.section('yourSection') %}
    {% set loopIndex = loop.index %}
    &lt;li&gt;"rs-{{loopIndex}}" id="slide-{{loopIndex}}-layer-2"&lt;/li&gt;
 {% endfor %}