Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在cypari上搜索了说明文档或手册,但找不到,我只找到以下代码 -
import cypari print(cypari.pari('factor({})'.format(2**127-2)))
所以,我不知道如何使用它。
给定您的命令,结果就像一对列表。第一个包含素数,第二个包含重数。要将其转换为字典格式sympy.ntheory.factorint,您可以使用
sympy.ntheory.factorint
res = cypari.pari('factor({})'.format(2**127-2)) d = {res[0][i] : res[1][i] for i in range(len(res[0]))}