Hi,

I am learning mobius inversion and i encounter a problem which I really didnt know whether this problem can be solve using mobius or not .If (Yes) then tell me how todo with mobius and if (Not) then tell me some other approach to solve this.

question - Given an array of integers (A) and a single integer (B) . Find the number of unordered pairs of (i,j) such that gcd(A[i],A[j]) is greater than (B) {gcd(A[i],A[j]) >B} . Answer should be large so we modulo it with 1e9+7.

This question was not from any ongoing contest .

Link where I encounter above question - https://codeforces.com/blog/entry/13290?#comment-509831

Array length - 1e5

1 <= A(i) <=1e5

1 <= B <= 1e5