Convert table look-up into function
It seems that your tables are 1-dimensional. So basically for an integer $x$ you define some value $T[x]$ and you are looking for a function $f$ such that $f(x)=T[x]$. 

There is a name for the problem that tries to find a function that runs through a given set of sample points, this is known as interpolation. Your problem is special, since your sample points are given by $(x,T[x])$ and the $x$s are the indices of your table.

The most classical approach is to use a polynomial as a function (but there is also theory about other classes of functions). It is a well known theorem that if you have $n$ samples, then you can find a polynomial $f(x)=\sum_{i=0}^{n-1} a_i x^i$ that coincides with your samples. There are different ways how determine the $n$ parameters $a_i$ of the polynomial.

One way to determine the polynomial is the method of Lagrange, you define for every index $i$ of you table the coefficient
$$L_i(x):=  \prod_{j=1,j\neq i}^{n} \frac{x-j}{i-j}.$$
If you look how $L_i(x)$ behaves on the samples, then you get
$$L_i(x)=\begin{cases} 1 &amp; x=i  \\ 0 &amp; x= \text{table index}\not= i \end{cases}.$$

Now you can easily come up with the desired polynomial by setting
$$f(x):=\sum_{i=1}^n T[i]L_i(x).$$
You can bring $f$ in the form $\sum_{i=0}^{n-1} a_i x^i$ if you like.

Concerning you example {4,5,7}, you get $$f(x)=4 ((x - 2)/-1*(x - 3)/-2) + 5 ((x - 1)*(x - 3)/-1) + 
 7 ((x - 1)/2*(x - 2))),$$
which simplifies to 
$$f(x)=4-\frac{x}{2}+\frac{x^2}{2}.$$

For further reading visit the Wikipedia page on interpolation. 

Here is a final remark. The table has in almost all cases the more compact representation, and it has the faster look-up time for sure.