📜  Python| sympy.udivisor_count() 方法

📅  最后修改于: 2022-05-13 01:55:44.255000             🧑  作者: Mango

Python| sympy.udivisor_count() 方法

sympy.udivisor_count()方法的帮助下,我们可以计算给定整数的酉除数的数量。

示例 #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))

输出:

The unitary number of divisors of 84 : 8

示例 #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))

输出:

The unitary number of divisors of 210 : 16