(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.
I have no idea how to solve these problems, any help? Thanks in advance!
For the first part, suppose $r \geq 2$. In the arithmetic sequence, there will be at least two terms which are integers; say these are $a + md$ and $a + nd$, in the standard notation for arithmetic sequences. Without loss of generality $m > n$. Since these terms are both integers, their difference $(m - n)d$ is also an integer. Now we can add $(m - n)d$ to $a + md$ to get $a + (2m - n)d$ which is also a member of the arithmetic sequence, and we know that adding two integers gives us another integer. Continuing this process would give us infinitely many integer terms in the sequence.
Thus $r = 1$. Can you see a similar way to prove the second part now?