Find the sum of all positive irreducible fractions less than 1 whose denominator is 2016. I know that we first have to use AP to find the sum of first 2015 natural nos. Then we need to subtract all those factors of 2016. But there are too many. I need help in this part.
 A: The prime factors of $2016$ are $2$, $3$ and $7$.
Hence use inclusion/exclusion principle:


*

*Include $\sum\limits_{n=1}^{2016}\frac{n}{2016}$

*Exclude $\sum\limits_{n=1}^{\frac{2016}{2}}\frac{2\cdot{n}}{2016}$

*Exclude $\sum\limits_{n=1}^{\frac{2016}{3}}\frac{3\cdot{n}}{2016}$

*Exclude $\sum\limits_{n=1}^{\frac{2016}{7}}\frac{7\cdot{n}}{2016}$

*Include $\sum\limits_{n=1}^{\frac{2016}{2\cdot3}}\frac{2\cdot3\cdot{n}}{2016}$

*Include $\sum\limits_{n=1}^{\frac{2016}{2\cdot7}}\frac{2\cdot7\cdot{n}}{2016}$

*Include $\sum\limits_{n=1}^{\frac{2016}{3\cdot7}}\frac{3\cdot7\cdot{n}}{2016}$

*Exclude $\sum\limits_{n=1}^{\frac{2016}{2\cdot3\cdot7}}\frac{2\cdot3\cdot7\cdot{n}}{2016}$

A: Too long for a comment. I'm trying to explain the method used by @barak manos.
So we want :
$$
\sum_{n=1|\ gcd(n,2016) = 1}^{2015} \frac{n}{2016}
$$
It is clear that any time $n$ is a multiple of either $2$, $3$, or $7$ then $gcd(n,2016) > 1$ because the prime factorization of $2016 = 2^5 \cdot 3^2 \cdot 7$. So we need to remove all multiple of $2$, $3$ and $7$. But we have to be careful because if we remove once all multiples of $2$ and then all multiples of $3$ then we would have removed $2$ times the multiples of $6$ ! This is where the principle of inclusion/exclusion come into play :


*

*Remove all multiples of $2$ and $3$ and $7$. This as for consequence to remove $2$ times the multiples of $6 = 2\cdot 3$, $14 = 2 \cdot 7$ and $21 = 3 \cdot 7$ and remove $3$ times the multiples of $42 = 2\cdot 3 \cdot 7$.

*Add back one time the multiples $6,14,21$ that we removed one time too many. However this will add back $3$ times the multiples of $42$. 

*So overall we still need to remove the multiples of $42$ that we remove $3$ times but reintroduced $3$ times after.

