#4 fits a 24/40 joint very well, #5 will sit ontop, also fitting it less well.
My suggestion to you is to buy ground glass jointed _everything_, really, it will make your life easier than trying to use rubber stoppers. (the only thing I do not recommend buying GG joints for is the thermometer... but do buy the 10/30 female joint connections... but when it comes to the actual thermometer, just use some teflon tape to get a regular thermometer to make a perfect seal--this is because, IMHO, O-rings suck and GG thermometers are too expensive)