Hello,

I see that many people use Python for PE. Can you recommend some libraries for number theory, i.e. fast implementations of factorization, primality test, etc?

## Python libraries for number theory

### Re: Python libraries for number theory

By this point in time, I've just implemented those functions all by hand in a global file I can include as needed. I think this is as well what many other higher members of PE have done as well. It was quite an exercise in learning to work through the theory to come up with a fast implementations for these. I don't believe any of the problems necessitates the use of a compiled library for functions.

ex ~100%'er... until the gf came along.

### Re: Python libraries for number theory

Do a search for ent.py (ent = elementary number theory), SAGE (free math system that you can download or use on-line, created by Dr. William Stein, who earlier developed ent.py routines.) You can also search for Python cookbook. Kirby Urner wrote some useful routines that can be found on-line.

One I haven't used, numpy, is probably useful; it may be accessible via SAGE.

Source code is included, so you can learn from it!

Some wikipedia articles on math contain python snippets.

Caveat: I am not so good at Python or these problems, and just search a lot when I get stuck, more persistence than skil in other words. So experts may improve or disagree with these suggestions.

One I haven't used, numpy, is probably useful; it may be accessible via SAGE.

Source code is included, so you can learn from it!

Some wikipedia articles on math contain python snippets.

Caveat: I am not so good at Python or these problems, and just search a lot when I get stuck, more persistence than skil in other words. So experts may improve or disagree with these suggestions.