maths.series.p_series ===================== .. py:module:: maths.series.p_series .. autoapi-nested-parse:: This is a pure Python implementation of the P-Series algorithm https://en.wikipedia.org/wiki/Harmonic_series_(mathematics)#P-series For doctests run following command: python -m doctest -v p_series.py or python3 -m doctest -v p_series.py For manual testing run: python3 p_series.py Attributes ---------- .. autoapisummary:: maths.series.p_series.nth_term Functions --------- .. autoapisummary:: maths.series.p_series.p_series Module Contents --------------- .. py:function:: p_series(nth_term: float | str, power: float | str) -> list[str] Pure Python implementation of P-Series algorithm :return: The P-Series starting from 1 to last (nth) term Examples: >>> p_series(5, 2) ['1', '1 / 4', '1 / 9', '1 / 16', '1 / 25'] >>> p_series(-5, 2) [] >>> p_series(5, -2) ['1', '1 / 0.25', '1 / 0.1111111111111111', '1 / 0.0625', '1 / 0.04'] >>> p_series("", 1000) [''] >>> p_series(0, 0) [] >>> p_series(1, 1) ['1'] .. py:data:: nth_term