Can I guess an irrational number formula from its digits?

If the irrational number is algebraic of degree two (i.e. is a root of a quadratic polynomial with integer coefficients), then there is a fairly reliable way to make an informed guess about the original value. Your sample case falls into this category, being equal to $10^{16} \sqrt{13} - n$ for some integer $n$. It's important to note that the vast majority of irrational numbers don't fall into any special category, let alone this particular one.

You will want to look up continued fractions. If the irrational is of the very special type I described above, then the continued fraction will be eventually periodic (infinitely repeating), very analogous to a decimal expansion being periodic for rational numbers.

Now, granted, if you only have a finite number of digits you can only extract a finite number of terms in the continued fraction expansion, so you can never have enough precision to be absolutely sure of the number's identity. Nevertheless, if you have 10000 digits you can likely extract thousands of terms. If you see that the terms look like, say,

$$[3; 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9, 3, 23, 8, 4, 3, 23, 8, 4, 3, 23, 8, 4, 3, 23, 8, 4, 3, 23, 8, 4, \ldots]$$

and that the patten of "8, 4, 3, 23" continues repeating thousands of times until you reach the precision allowed by your input sample, it would be reasonable to guess that it continues forever, and then there are simple ways to compute the exact value that it would be assuming that is the case.


No matter how many digits of an irrational number you know, there will be an infinite amount of irrational (and even rational!) numbers that start with those digits. So your 'formula' will only give you one of them.

Also, there are a lot more (in a very specific sense) irrational numbers than formulas (of finite length, as Brian Tung pointed out).