I got stucked on this problem for a while(about 30min). My code runs in 0.826311s with primesieve library.
In my opinion, this is a median task and not a very easy one said by others. It’s evident that gcd(d, n / d) = 1 is an important condition. Besides, you have to know how to compute all primes of a factorial and finally you should come up with a simpley DP method.
There are totaly 1435 person got this task solved by today.