以整数 162 为例:
它的质因子是 [2, 3], 160 = 2^1 * 3^4 (设两个幂 a=1, b=4)
其实它的因子就是由各个质因子的 0-n 次幂的组合相乘而来,
2^0 * 3^0 = 1
2^1 * 3^0 = 2
2^0 * 3^1 = 3
2^1 * 3^1 = 6
2^0 * 3^2 = 9
2^1 * 3^2 = 18
2^0 * 3^3 = 27
2^1 * 3^3 = 54
2^0 * 3^4 = 81
2^1 * 3^4 = 162
所以,整数162 的全部因子是 [1, 2, 3, 6, 9, 18, 27, 54, 81, 162],
整数162 的因子的个数就是 (a+1)*(b+1) = 2*5 = 10
同理,如果推算整数 150:
它的全部因子是 [1, 2, 3, 5, 6, 10, 15, 25, 30, 50, 75, 150]
它的质因子是 [2, 3, 5], 150 = 2^1 * 3^1 * 5^2 (设三个幂 a=1, b=1, c=2)
其实它的因子就是由各个质因子的 0-n 次幂的组合相乘而来,
2^0 * 3^0 * 5^0 = 1
2^1 * 3^0 * 5^0 = 2
……
2^1 * 3^1 * 5^2 = 150
所以,整数150 的因子的个数就是 (a+1)*(b+1)*(c+1) = 2*2*3 = 12
标签:与质,关系,12,150,整数,因子,162,10 From: https://blog.51cto.com/u_13946099/7717977