first make sure that it does NOT have an outer flange that would sit around the outer surface of the K mount, as this would mean that the lens would not be able to achieve infinity focus. Or in other words, it must look similar to the original Pentax adapter which will fit flush 'inside' the K mount without introducing distance between lens and film plane.
here a sample of one with an outer flange that must be avoided:
http://www.ebay.com/itm/Adapter-Rin...843?pt=LH_DefaultDomain_0&hash=item2597284993
many of the cheap ones are a pain to take off, and one must use a provided tool. Well, this is what I have read others tell, I only have used an original Pentax ( besides some with flange mentioned above that are to be avoided, I used those as replacement mounts for changing lens mounts to Pentax K, for that they work well ) and the original Pentax adapter is easy to take off just with a fingernail, no other tool required.
some ( not the original Pentax ) have an 'inner flange' which would press down a pin some lenses need to have pressed down for their aperture to work. These ( used to be, have not checked situation for a while now ) are not cheap adapters, Takumar lenses don't need that inner flange, other M42 lenses may.
for example:
http://www.ebay.com/itm/FLANGED-M42...054?pt=LH_DefaultDomain_0&hash=item339f78244e
Kipon has inner flange too:
http://www.ebay.com/itm/New-Kipon-A...840?pt=LH_DefaultDomain_0&hash=item1c2d979020
in short: I'd recommend to get an original Pentax adapter, if it must be a cheaper one just make sure that it does not have an outer flange, if you need it to depress a pin at the rear of the lens, look for one with an inner flange