Algorithms for solving algebra and number theory related problems