📜  Python| sympy.antidivisor_count() 方法

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

Python| sympy.antidivisor_count() 方法

sympy.antidivisor_count()方法的帮助下,我们可以找到给定整数的反除数的计数。

示例 #1:

# import antidivisor_count() method from sympy
from sympy.ntheory.factor_ import antidivisor_count
  
n = 24
  
# Use antidivisor_count() method 
antidivisor_count_n = antidivisor_count(n) 
      
print("The number of anti-divisors of {} : {}".format(n, antidivisor_count_n))

输出:

The number of anti-divisors of 24 : 2

示例 #2:

# import antidivisor_count() method from sympy
from sympy.ntheory.factor_ import antidivisor_count
  
n = 128
  
# Use antidivisor_count() method 
antidivisor_count_n = antidivisor_count(n) 
      
print("The number of anti-divisors of {} : {}".format(n, antidivisor_count_n))

输出:

The number of anti-divisors of 128 : 6