mathincubator / mathlib

A math lib for scientific computing
Apache License 2.0
0 stars 1 forks source link

Number of Factors of a Number #61

Open mathincubator opened 3 years ago

mathincubator commented 3 years ago

To find the number of factors of a number:

  1. Find the prime factorization of the number

  2. Add 1 to all of the exponents

  3. Multiply them together

If the prime factorization of the number is expressed as pe11 × pe22 × ⋅ ⋅ ⋅ × pekk then the number of factors of the number is (e1 + 1) (e2 + 1)... (ek + 1)