Just a short tip on how to potentially solve this.
Take a close look at the given example number of 30.
All its divisors form a pair: 1 and 30, 2 and 15, 5 and 6, 3 and 10.
If the sum of each individual pair is prime, you found a prime generating integer:
1 + 30 = 31
2 + 15 = 17
5 + 6 = 11
3 + 10 = 13
All prime.
Which is exactly what the problem description states by giving you the formula d + n/d.