My experience dictates buying the official Pentax ones. I don't know where you are so that may be a pricey option for you. I bought a couple aftermarket adapters and they were machined so poorly that I could not get the damn thing off of the camera. It actually left metal shavings around the lens mount inside the mirror box on my K10d (that was fun cleaning out). I never tried the second one and returned both of them. Since then, Pentax only. My preference. I own 2 of them. As noted by RioRico, the aftermarkets Can work (lots of people use them), just be careful with them.
It should be noted that I own exactly 4, M42 lenses and they may see the camera 2 or 3 times per year.