Python | sympy.udivisor_count() method
Last Updated :
28 Aug, 2019
With the help of sympy.udivisor_count() method, we can count the number of unitary divisors of the given integer.
Syntax: udivisor_count(n, modulus=1)
Parameter:
n – It denotes an integer.
Returns: Returns the count of unitary divisors of the given integer.
Example #1:
from sympy.ntheory.factor_ import udivisor_count
n = 84
udivisor_count_n = udivisor_count(n)
print ( "The unitary number of divisors of {} : {}" . format (n, udivisor_count_n))
|
Output:
The unitary number of divisors of 84 : 8
Example #2:
from sympy.ntheory.factor_ import udivisor_count
n = 210
udivisor_count_n = udivisor_count(n)
print ( "The unitary number of divisors of {} : {}" . format (n, udivisor_count_n))
|
Output:
The unitary number of divisors of 210 : 16
Share your thoughts in the comments
Please Login to comment...