Monday, October 6, 2025
HomeLanguagesPython | sympy.udivisor_count() method

Python | sympy.udivisor_count() method

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:




# import divisor_count() method from sympy
from sympy.ntheory.factor_ import udivisor_count
  
n = 84
  
# Use udivisor_count() method 
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:




# import divisor_count() method from sympy
from sympy.ntheory.factor_ import udivisor_count
  
n = 210
  
# Use udivisor_count() method 
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
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32338 POSTS0 COMMENTS
Milvus
86 POSTS0 COMMENTS
Nango Kala
6707 POSTS0 COMMENTS
Nicole Veronica
11871 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11936 POSTS0 COMMENTS
Shaida Kate Naidoo
6825 POSTS0 COMMENTS
Ted Musemwa
7089 POSTS0 COMMENTS
Thapelo Manthata
6779 POSTS0 COMMENTS
Umr Jansen
6781 POSTS0 COMMENTS