Given an array A of N integers, where each Ai <= 10^5 . For each number i calculate number of non-empty subsets with gcd = i, where i β [1,10^5]

Can anyone provide their approach along with its time complexity.

Also if possible provide pseudo code, it will be much helpful.

Thank You!