Originally posted by Ole
That pin is harmless. The pins that cause trouble are on certain non-Pentax K-mount lenses.
Specifically, some (not all) lenses made to work on Ricoh P series cameras. This would include Rikenon P and lenses with K/R, PK/R, PKA/R, KA/R, etc. on the base or side. The "Ricoh Pin" is a pin or ball fitting that can lodge in the autofocus coupler on the mount. With the pin, the lens may be extremely difficult to remove. With the ball type the issue is much less severe.
Ricoh lenses other than the Rikenon P are quite safe on your camera and are often an excellent value.
As for the pin on your lens...It actuates the iris diaphragm when the lens is attached to a M42 screw mount camera.
Steve