Solution:
We first match the outputs to the inputs. To start, we observe that since a≥0 (since the answer to the problem is nonnegative), we must either have f(858522)≈4.39⋅1012 or f(177883)≈4.39⋅1012. However, since 858522 is relatively close to 796921, the first case is unrealistic, meaning that the second case must be true.
Now, looking mod 2, we find that f(796921)≈1.32⋅1012. Additionally, we find that mod 5, f(1)≡f(3)≡0(mod5), so f(x)≡a(x−1)(x−3)(mod5). Modulo 5, we now have {3a,4a}={f(0),f(2)}={2,4}, so it follows that a≡3(mod5), f(349710)≈1.78⋅1012 and f(858522)≈1.98⋅1012.
There are several ways to finish from here. One (somewhat tedious) method is to use mod 9, which tells us that f(7)=7, f(5)=8, f(3)=4, which tells you that a≡5(mod9) (take a finite difference). This tells you that a≡23(mod45), and a≥68 can be ruled out for being too large.
Another method is to work with the numbers themselves. One way to do this is to note that for quadratic polynomials,
f′(2x+y)=y−xf(y)−f(x)
Using this for {177883,348710} and {796921,858522}, we find that f′(260000)≈−1500000 and f′(830000)≈1000000. Thus f′ (which we know must be linear with slope 2a) has slope just less than 50.
Either way, we find that a=23. The actual polynomial is 8529708870514−27370172x+23x2.