I am trying to have Mathematica find the polynomial of degree $n$ in a single variable which fits the given points $(x_1,y_1),\dots, (x_{n+1},y_{n+1})$. In the examples I am concerned with, the polynomials will always have rational number coefficients. Here is an example of the code I am using with $n=3$
Normal[LinearModelFit[{{0, 10}, {1, 35}, {2, 81}, {3, 154}}, x^Range[0, 3], x]]
Mathematica gives the following answer:
10.+16.5 x+7.5 x^2+1. x^3
How do I get Mathematica to give the answer with the coefficients presented as fractions rather than as decimal expansions?
Rationalize
$\endgroup$