Question 164
Let $a$, $b$, and $d$ be integers satisfying $d \ge 0$, $|a| \ge 2$, and $b \ge (|a| + 1)^{d+1}$. Suppose $f(x)$ is a real-coefficient polynomial of degree $d$, and for each positive integer $n$, let $r_n$ denote the remainder of $\lfloor f(n)a^n \rfloor$ modulo $b$.
Prove that if the sequence $r_n$ is ultimately periodic, then $f(x)$ is a rational-coefficient polynomial.
*Note 1:* For every real number $x$, $\lfloor x \rfloor$ denotes the largest integer that is not greater than $x$.
*Note 2:* A sequence $a_n$ is called *ultimately periodic* if there exist positive integers $n_0$ and $T$ such that for every integer $n \ge n_0$, we have $a_{n+T} = a_n$.
Prove that if the sequence $r_n$ is ultimately periodic, then $f(x)$ is a rational-coefficient polynomial.
*Note 1:* For every real number $x$, $\lfloor x \rfloor$ denotes the largest integer that is not greater than $x$.
*Note 2:* A sequence $a_n$ is called *ultimately periodic* if there exist positive integers $n_0$ and $T$ such that for every integer $n \ge n_0$, we have $a_{n+T} = a_n$.