GaspareG

Hello to the most amazing Christmas event. The X^n-Mas!
You can send at most 50 requests to the server.
The modulo is 1705110751. Good luck!

Then we can ask to the server to compute for some x the value f(x), for example:

Enter a integer:0
The output is: 125

Enter a integer:1
The output is: 3458

Enter a integer:2
The output is: 26558034

All the numbers written are modulo 1705110751 and the inserted integer should be in the range [0, 1705110750].

Fortunately we see that if reconnect to the server all the values, including the modulo, remain the same, so the limit of 50 requests is only fictitious, as we can reopen the connection and ask the value for more x.

Now let’s start to do some math!

The random polynomial function is in the form:

f(x) = c_0*x^0 + c_1*x^1 + c_2*x^2 + ... + c_d*x^d (mod 1705110751)

For some degree d and we want to retrieve all the values of c_i.

Now we have that :

f(x) = c_0

f(1) = c_0 + c_1 + c_2 + ... + c_d.

f(2) = c_0 + 2^1*c_1 + 2^2*c_2 + ... + 2^d*c_d.

(Note that c_0 is equal to 125 the ASCII-code of }, so we are in the right path!)