(a) Determine all nonnegative integers r such that it is possible for an infinite arithmetic sequence to contain exactly r terms that are integers. Prove your answer.
(b) Determine all nonnegative integers r such that it is possible for an infinite geometric sequence to contain exactly r terms that are integers. Prove your answer.
\(a)~a_n = a_0 + n d,~n \in \mathbb{Z^+},~d,a_0 \in \mathbb{R}\\ \text{Suppose there are 2 or more integers in the sequence, at say $k_1,~k_2$}\\ a_0 + k_1 d \in \mathbb{Z} \text{ and }a_0 + k_2 d \in \mathbb{Z}\\ (k_1-k_2)d \in \mathbb{Z}\\ m(k_1 - k_2)d \in \mathbb{Z},~m \in \mathbb{Z}\\ a_0 + k_1 d + m(k_1-k_2)d \in \mathbb{Z}\\ \text{This corresponds to index }\\ (m+1)k_1 - mk_2\\ \text{and thus there are infinitely many integers in the sequence as $m \in \mathbb{Z}$}\)
\(\text{On the other hand we can easily form a sequence with 1 integer by having $\\a_0 \in \mathbb{Z},~d \not \in \mathbb{Q}$}\)
.