Size of array<=10^5 and each element in array is 2<=Ai<=10^5. Is there any way to calculate all the coprime pairs (Ai,Aj) where 1<=i,j<=100000 in O(nlogn) ?
Any idea how to use mobious function to solve this?
Size of array<=10^5 and each element in array is 2<=Ai<=10^5. Is there any way to calculate all the coprime pairs (Ai,Aj) where 1<=i,j<=100000 in O(nlogn) ?
Any idea how to use mobious function to solve this?