Equation f (x) = 5 * x ^ 13 + 13 * x ^ 5 + K * a * X; input any number k, whether there is a number, any X can enable f (x) to be 65 integers. Assume that the number a exists, because it is true for any x equation. When x = 1, F (x) = 18 + KA and f (x) if n is an integer, f (x) = N * 65 is obtained. That is, 18 + Ka = N * 65. Because N is an integer, if the equation is to be established, the problem is converted to. For a given range, you only need to verify whether there is a so that (18 + K * A) % 65 = 0, so it is easy to understand, here, we do not understand that mao a only needs to reach 65, because when a = 66, it is equivalent to finding a cycle, so if you need to prove it again, you can simply use the order of the modulo process and the number operation to prove the switching principle, I won't prove it here ..
Code:
# Include <stdio. h>
Int main ()
{
Int K, I, flag;
While (scanf ("% d", & K )! = EOF)
{
Flag = 1;
For (I = 1; I <65; I ++)
{
If (18 + I * k) % 65 = 0)
{
Printf ("% d \ n", I );
Flag = 0;
Break;
}
}
If (FLAG) printf ("NO \ n ");
}
Return 0;
}