Recassim Succession =================== Let's consider an infinite mathematical succession defined for a given :math:`a_0 \geq 0` by the following recursive rules: .. math:: a_i= \begin{cases} a_0, &\mbox{if } i = 0 \\ a_{i-1} - i, &\mbox{if } t = (a_{i-1}-i) \mbox{ is such that } t>0 \mbox{ and } t \mbox{ does no belong to the succession so far.} \\ a_{i-1} + i, &\mbox{otherwise} \end{cases} for all :math:`i \geq 0`. For instance, given :math:`a_0 = 0` the initial terms of the succession are: $$ 0,1,3,6,2,7,13,20,12,21,11,⋯ $$ Observe that, on the one hand the 3rd term is 6 since the 2nd term is 3 and 3-3 is not `>0` therefore :math:`t_3 = 3+3 = 6`. On the other hand, :math:`t_4 = 2` since :math:`t_3−4 = 2`. The next image graphically shows the first 100 terms for :math:`a_0 = 0`: .. image:: RSeqPlot.png :scale: 100% :align: center Please implement the following Python function in the :mod:`recassim` module (:file:`recassim.py` file): .. py:function:: : recassim(a0, n): such that **given** - ``a0``, an :class:`int` such that ``a0 >= 0``. - ``n``, an :class:`int` such that belongs to the succession. **returns** the index of the first occurrence of ``n`` in the succession (notice that a value may appear more than once). For example, .. literalinclude:: recassim.test :language: python :start-after: --ini :end-before: --fi Doctests are available at the :download:`recassim.test ` file.