MathTop

proper_divisors 函数

返回 n 的正因数,但不包含 n 本身。

语法

  • NumberTheory:-ProperDivisors(n)
  • proper_divisors(n)
  • properdivisors(n)

参数与选项

n要检查的正整数。

示例

  1. 真因数proper_divisors(28)返回 [1, 2, 4, 7, 14]。
  2. 包形式NumberTheory:-ProperDivisors(28)返回 [1, 2, 4, 7, 14]。