Can’t able to identify the problem.My approach was to find the divisors of each element of array. then merge the factors, then apply the formula (x+1)(y+1)…
Problem in Number of primes
this is basic sieve algorithm , by seive u get all the elements which are prime store it into another array then just asses the prime by index. i hope u get it .