Algorithmic number theory

Eric Bach and Jeffrey Shallit
MIT Press
9780262024051
0-262-02405-5