For each number, list its divisors in pairs (d, num / d) with d up to the square root. Add the divisor sum only when there are exactly four.
nums (green = exactly four divisors, with the sum it adds)
Divisors come in pairs d and num / d, so testing d up to the square root finds them all.