Since we are told that a pair of 3s are amongst the prime factors of n, the semiprime 9 is a factor, and since 9 is 2 greater than a prime, 7 is also a factor. So another semiprime factor is 21, therefore 19 is a prime factor. Of the semiprime factors involving 19, 133 is 2 greater than a prime number, so 131 is also a prime factor of n. Of the semiprimes involving 131, there are none that are 2 greater than a prime, so we can stop there.
n is therefore 3x3x7x19x131 = 156807.
There could be other factors, for instance if 41 were also a prime factor, the rule would still be satisfied, since 41 in not 2 less than a semiprime, and each of the semiprimes involving 41 would not be 2 greater than a prime, so 156807 is merely the smallest.
For the second challenge, we need to introduce another prime factor, as small as possible.
It cannot be 2, as that would imply 4 divides too, but we know we can’t have any more repeat prime factors.
If it was 5, that implies 13 is also a factor, so we’ll put that to one side.
If it was 11, 31 would also be a factor.
13 implies 5 is a factor, as we’ve already seen.
If 17 is a factor, none of the semiprimes formed with it are 2 greater than a prime, and 17 itself is not 2 less than a semiprime, so we can stop there.
Therefore multiplying the previous answer by 17 gives the next smallest: 2665719.