Numerical series ================ Save all functions into a file named ``numerical_series.py``. A. A numerical series is defined as: :math:`x_1 = 1` :math:`x_{i} = \begin{cases} x_{i-1} + 5 , & \mbox{if } i-1 \mbox{ is even} \\ 2x_{i-1} , & \mbox{if } i-1 \mbox{ is odd} \\ \end{cases}` 1. Write the function :py:func:`even_odd_1` that given an integer *n*, returns the average of the *n* first values of the defined numerical series. Examples: .. literalinclude:: even_odd_1.txt :language: python3 :lines: 3- .. note:: More tests are provided in file :download:`even_odd_1.txt ` 2. Write the function :py:func:`even_odd_2` that given a value *xmax*, returns the average of the values of the defined numerical series, lower than *xmax*. Example: .. literalinclude:: even_odd_2.txt :language: python3 :lines: 3- .. note:: More tests are provided in file :download:`even_odd_2.txt ` B. Given two integers *a* and *b*, such that *a>0* and *0< b< 10*, the following numerical series is defined: :math:`x_1 = a` :math:`x_i = \begin{cases} 2x_{i-1}, & \mbox{if } x_{i-1} \mbox{ is multiple of b or its last digit is b} \\ 3x_{i-1} +b, & \mbox{if } x_{i-1} \mbox{ is not multiple of b and its last digit is not b}\\ \end{cases}` 1. Write the function :py:func:`sum_terms_1` that takes the values of ``a``, ``b`` and ``n``, and returns the addition of the ``n`` first terms of the given numerical series Examples: .. literalinclude:: sum_terms_1.txt :language: python3 :lines: 3- .. note:: More tests are provided in file :download:`sum_terms_1.txt ` 2. Write the function :py:func:`sum_terms_2` that takes the values of ``a``, ``b`` and ``xmax``, and returns the addition of the terms of the given numerical series, lower than ``xmax``. Examples: .. literalinclude:: sum_terms_2.txt :language: python3 :lines: 3- .. note:: More tests are provided in file :download:`sum_terms_2.txt ` .. rubric:: Solution A solution of these functions is provided in file :download:`numerical_series.py `