Given a sequence a1, a2, ..., aN. Count the number of triples (i, j, k) such that 1 ≤ i < j < k ≤ N and GCD(ai, aj, ak) = 1. Here GCD stands for the Greatest Common Divisor.
http://www.codechef.com/LTIME13/problems/COPRIME3
the editorial is very difficult to understand,,isn't there any other methods??
Explicit introduction of mobius function in the editorial is unnecessary. Do you know the inclusion-exclusion principle?
no,i don't know how to use in coding,,i just know the mathematical definition @pompon any help will be great for this noob :)
Here you have a tutorial on how to apply inclusion-exclusion principle in general: http://apps.topcoder.com/forums/?module=Thread&threadID=685138&start=0