# What's the best way to detect an algebraic number?

Suppose you calculate the first few (dozen, hundred) digits of a number which you believe to be a rational number. You can calculate the continued fraction for the number and truncate after a large number:

$$0.67272727272727745455778089309\approx[0; 1, 2, 17, 1, 69929887587, 5, 1, 1, 2, 2]$$

is probably $[0; 1, 2, 17, 1]=37/55.$

I'm wondering if there is a similarly good method for finding an algebraic number, ideally one that I can use in some computer system since large numbers are hard to work with by hand.

-
RootApproximant in Mathematica does just that, if you have access to it. Implementing similar algorithm requires access to lattice reduction algorithm, such as LLL or PSLQ. – Sasha Jan 31 '12 at 20:24
algdep works on PARI/GP. – Charles Jul 8 '13 at 22:55
Python's mpmath module has a findpoly function. – Dan Stahlke Mar 23 '14 at 17:45

Yes, PLSQ is used on the finite set $\{1, \; \lambda, \; \lambda^2, \; \ldots, \; \lambda^n \}$ in hopes of finding a polynomial with integer coefficients for which the number $\lambda$ is a root. If such is found, sometimes the apparent relation can be proved to be correct.