Ask Your Question

Integer polynomial factorization and RecursionError

asked 2022-12-21 01:31:31 +0200

nickux gravatar image

Hi all,

I use sage to factorize integer polynomials, sometimes with very large coefficients. But when the polynomial is too large (for example a degree 3885), I get the following error

RecursionError: maximum recursion depth exceeded during compilation

I have tried to set a higher recursion limit through, e.g.


But I still get the same error. The script file is also large (more than 7Mb) and the file is even larger (22Mb).

Thanks for your help.

edit retag flag offensive close merge delete


Please provide an example illustrating the issue.

Max Alekseyev gravatar imageMax Alekseyev ( 2022-12-24 04:16:32 +0200 )edit

Sure. Here is a link to a script file producing such an error (example.sage)

nickux gravatar imagenickux ( 2022-12-25 03:30:39 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2023-01-10 15:41:45 +0200

nickux gravatar image


I manage to find a workaround. For people interested in, I directly wrote a python code rather than letting sage writing its own python. From there, I split the polynomial such that each smaller polynomial contains at most 1000 terms. Then I define the full polynomial as the sum of these smaller ones.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2022-12-21 01:31:31 +0200

Seen: 111 times

Last updated: Jan 10 '23

Related questions