0

I searched instruction documents or manuals on cypari but couldn't found, I found the below code only -

import cypari
print(cypari.pari('factor({})'.format(2**127-2)))

So, I don't know how to use it.

1 Answers1

0

Given your command, the result is like a pair of lists. The first one contains the primes, the second the multiplicities. To convert it into dictionary format like sympy.ntheory.factorint, you can use

res = cypari.pari('factor({})'.format(2**127-2))
d = {res[0][i] : res[1][i] for i in range(len(res[0]))}
Hennich
  • 682
  • 3
  • 18