Theorem:Originally Posted by Treadstone 71
Let p be a prime >3, then all three of p, p+2, p+4 cannot be prime, because
at least one of them must be divisible by 3.
Suppose p>3 and not divisible by 3, then there exist k>0 such that
p=k.3+r, where r is either 1 or 2 (r cannot be 0 since then p would be
divisible by 3, which it is not by supposition).
If r=1 then p+2 is divisible by 3.
If r=2 then p+4 is divisible by 3.
Note: this is stated on page 5 of Hardy and Wright (fifth edition)
but without the restriction that p>3, so failing to exclude 3,5,7!
Your problem is a corollary of the theorem. For if p>3 and p and p+2
are both prime neither of them is divisible by 3, so p+4 must be
divisible by 3.