maths.basic_maths ================= .. py:module:: maths.basic_maths .. autoapi-nested-parse:: Implementation of Basic Math in Python. Functions --------- .. autoapisummary:: maths.basic_maths.euler_phi maths.basic_maths.number_of_divisors maths.basic_maths.prime_factors maths.basic_maths.sum_of_divisors Module Contents --------------- .. py:function:: euler_phi(n: int) -> int Calculate Euler's Phi Function. >>> euler_phi(100) 40 >>> euler_phi(0) Traceback (most recent call last): ... ValueError: Only positive numbers are accepted >>> euler_phi(-10) Traceback (most recent call last): ... ValueError: Only positive numbers are accepted .. py:function:: number_of_divisors(n: int) -> int Calculate Number of Divisors of an Integer. >>> number_of_divisors(100) 9 >>> number_of_divisors(0) Traceback (most recent call last): ... ValueError: Only positive numbers are accepted >>> number_of_divisors(-10) Traceback (most recent call last): ... ValueError: Only positive numbers are accepted .. py:function:: prime_factors(n: int) -> list Find Prime Factors. >>> prime_factors(100) [2, 2, 5, 5] >>> prime_factors(0) Traceback (most recent call last): ... ValueError: Only positive integers have prime factors >>> prime_factors(-10) Traceback (most recent call last): ... ValueError: Only positive integers have prime factors .. py:function:: sum_of_divisors(n: int) -> int Calculate Sum of Divisors. >>> sum_of_divisors(100) 217 >>> sum_of_divisors(0) Traceback (most recent call last): ... ValueError: Only positive numbers are accepted >>> sum_of_divisors(-10) Traceback (most recent call last): ... ValueError: Only positive numbers are accepted