整数的素因数分解(Prime factorization of an integer,factor_integer)
整数的质因数分解,以质数和指数成对的列表给出。
怎么写
factor_integer(n)
- n
- 一个整数。接受一个整数。
示例
factor_integer(60)在求解器中,
在求解器中打开factor_integer(60)的结果是[[2, 2], [3, 1], [5, 1]]。
相关函数
- integer_exponent
某个素数在一个整数中的指数。
- integer_partitions
把一个整数写成正整数之和的所有方式。
- fibonacci
第 n 个斐波那契数,其中 F(1) = F(2) = 1。
- extended_gcd
两个整数的最大公因数,以及得到它的乘数。
- from_continued_fraction
连分数所表示的数。
- euler_phi
欧拉函数:不超过 n 且与 n 互质的整数有多少个。