[Math] Integers divisible by 5 but not divisible by 7 are countably infinite

functionsintegers

I have searched for the answer to this question online and have come across some answers, however, I am struggling to understand it. How would I come up with a function for which the integers are multiples of 5 but not multiples of 7? I also want to show a one-to-one correspondence with the set of positive integers, so that I can prove it is countably infinite. This is what I have so far:

$$ f : \mathbb{Z+} \to \mathbb{P}
\quad\text{defined by}\quad
f(n) = \begin{cases}
5(\frac{n}{2}) & \text{if $n$ is even, and} \\
5(\frac{n-1}{2}) & \text{if $n$ is odd.} \\
\end{cases}
$$

where P is the set of integers that are multiples of 5. Now I am struggling to alter it so that the multiples of 7 (35, 70, 105, …etc) are not included. Can someone perhaps help me and show me how to prove that there is a one-to-one correspondence with the set of positive integers.

Best Answer

Note that one way to avoid factors of $7$ is to just repeatedly multiply by $5$ (why does this work?). For example, the recursive function: $$f_{n+1} = 5*f_n,\hspace{0.2in}f_1 = 1.$$ is only divisible by $5$ for any $n$, but not $7$.