Algorithms in number theory