Finding the integers between {1, 2, ..., 100} that are divisible by 2 or 3 but not both. I'm having trouble determining this problem.
I need to find the integers in the set {1, ... , 100} that are divisible by 2 or 3 but not both.
The way I tried to approach it was:
If a number is divisible by both 2 and 3 then we can say it is divisible by 6. So we need to exclude integers divisible by 6. From here am I supposed to just go through each integer? Or is there a better way to approach this?
Thanks
 A: Hint: In the set $\{1,\cdots, 100\}$, count the number of multiples of $2$. Then count the number of multiples of $3$, and add the two numbers together. Then subtract twice the number of multiples of $6$. Note that the number of multiples of $6$ is $\lfloor 100/6 \rfloor = 16$, since they are:
\begin{align*}
6(1) &= 6, \\
6(2) &= 12, \\
&~~\vdots \\
6(16) &= 96
\end{align*}
A: Every integer can be written in the form $n=6q+r$ by a division by $6$ ($r$ is the remainder of the division). The term $6q$ is a multiple of both $2$ and $3$, so it suffices to reason on the divisibility of the remainder.
The remainders are periodic,
$$\color{blue}{1,2,3,4,5,0},1,2,3,4,5,0,\color{blue}{1,2,3,4,5,0},1,2,3,4,5,0,\color{blue}{1,2,3,4,5,0,}\cdots$$
The then truth values of the condition "divisible by 2 or 3 but not both" are
$$\color{blue}{f,t,t,t,f,f,}f,t,t,t,f,f,\color{blue}{f,t,t,t,f,f,}f,t,t,t,f,f,\color{blue}{f,t,t,t,f,f,}\dots$$
You can summarize by saying, "skip $1$, then repeatedly take $3$ and skip $3$".
