I was exploring some sum when I came across this sum which I have no idea the value, here is the sum
Let $ N $ be an integer with the prime decomposition $ N = p_1^{k_1} p_2^{k_2} ... p_m^{k_m} $.
Let $ a $ be another integer such that $ 0 < a < N $. Consider the sum
\begin{align} \sum_{1 \leq i \leq m} \left \{ \frac{a}{p_i} \right \} - \sum_{1 \leq i < j \leq m} \left \{ \frac{a}{p_i p_j} \right \} + ... + (-1)^m \left \{ \frac{a}{p_1 p_2 ... p_m} \right \} \end{align} where $ \{ x \} = x - \lfloor x \rfloor $ is the factional part function.
I did some numerical calculations and found that the sum is generally small. For some values of $ a $, the sum may get large, but its absolute value seems to be bounded by $ m - 1 $, where $ m $ is the number of distinct prime factors of $ N $ as above.
My question is, is there currently a known formula/estimate/bound (in terms of $ a $ and $ N $) for the sum above?
(Realize that I did not really phrase the original question that well, so I edited some part of the post)
First observation: the fractional part of the result stays the same if you take the fractional part at the end (only the whole part may change).
Second observation: taking the fractional part of a quotient is the same as taking the remainder of division.
You can rewrite this as
$$\sum \frac{a\mod p_i}{p_i}-\sum \frac{a \mod p_i p_j}{p_i p_j}+\cdots$$
Now observe what happens when you keep adding one more prime to the set of primes $p_i$. With a single prime it's trivial. Adding more, it starts looking like you'll be able to use the Chinese Remainder Theorem once you take them to the common denominator. Can you continue?