How many positive integers $ n$ with $1 \le n \le 2500$ are prime relative to $3$ and $5$? I am trying to understand this example from my study guide and am getting no where with it and need some help.
Example: How many positive integers $n$ with $1 \le n \le 2500$ are prime relative to $3$ and $5$? 
The example come from the chapter on Venn Diagrams.
Let $U = \{n \in \Bbb Z_+ \mid 1 \le n \le 2500\}$.
We need to establish the number of positive integers in $U$ such that
$\gcd(3, n) = 1$ and $\gcd(5, n) = 1$.
In this case, it is easier to count the integers that are relative primes with $3$ and $5$.
Note that an integer is not a relative prime with $3$ if it is a multiple of $3$. Thus,
$$A = \{n \in U\mid \gcd(3, n) = 1\} = \{3n \in U\mid 1 \le n \le 1249\}.$$  Can someone explain how $249$ is obtained?
and 
$$B = \{n \in U\mid \gcd(5, n) = 1\} = \{5n \in U\mid 1 \le n \le 500\}.$$ Can someone explain how $500$ is obtained?
Thus, $A = \{n \in U\mid \gcd(3, n) = 1\}$ and $B = \{n \in U\mid \gcd(5, n) = 1\}$.
We want to find $|A \cap B| = |A \cup B| = |U| − |A \cup B|$.
We have 
$|A \cap B| = |\{15k \in U \mid 1 \le k \le 166\}| = 166$.
Thus,
$|A \cap B| 
= |U| − |A| − |B| + |A \cap B| 
= 2500 − 1249 − 500 + 166 = 917$
Thanks for any help.
Tony
 A: Basically, let A be the set of integers between 1 and 2500 inclusive which are multiples of 3 and B be the set of integers between 1 and 2500 inclusive which are multiples of 5. The cardinality of the set of integers which are divisible by 3 or 5 or both is $|A \cup B| = |A|+|B|-|A\cap B|$ (by the inclusion exclusion principle) and so the cardinality of the set of integers relatively prime to 3 and 5 (call it $|R|$, noting that $R = (A \cup B)'$) will be $|(A \cup B)'| = |U| - |A \cup B| = 2500-(|A|+|B|-|A\cap B|)$ where $|A \cap B| =$ the set of integers between 1 and 2500 inclusive divisible by 3 and 5 (i.e. divisible by 15) so $|A\cap B|$ = floor(2500/15) = $\lfloor \frac {2500}{15} \rfloor = 166$.
Thus $|R| = 2500-(833 + 500 - 166) = 2500-1167 = 1333$
A: Write the numbers between $1$ and $2490$ inclusive as $15\times k +l$, $k$ and $l$ integers, where $k$ goes from $0$ to $165$, and $l$ goes from $1$ to $15$.
$15\times k$ is divisible by both $3$ and $5$;  adding $l=3, 5, 6, 9, 10, 12, \text{or } 15$ will give a value that is divisible by $3 \text{ and/or } 5$.  So $8$ of the values of $l$ give numbers co-prime to 3 and 5.  So there are $8\times 166
\text{, or }1328$ numbers in this partial range coprime to 3 and 5
Adding $5$, for $2491, 2492, 2494, 2497 \text{ and }2498$, gives a total of $1333$ numbers that satisfy the given conditions.
Edited:  forgot $k=0$
A: You can tackle this using probablity theory.
The probability that a number is not divisible by $3$ is $1-\frac{1}{3}$ and likewise for $5$ the probability is $1-\frac{1}{5}$.  Since $3$ and $5$ are prime and thus coprime, these are independent events and the probability of not being divisible by both numbers is given by their product.  Thus, the amount of positive integers $n \leq 2500$ that are coprime to $3$ and $5$ is:
$$\left(1-\frac{1}{3}\right)\left(1-\frac{1}{5}\right)2,500 = 1,333.\overline{33}$$
We round this number down to get our answer of $1,333$.
