It primarily depends on the flange distance. See this wikipedia article on lens mounts. You'll see that Nikon's F mount is further out than PK's. Meaning that to make this work, you'd have to remove the mount from your Nikon camera, maybe even file some of its frame away, so that the Pentax lens could be placed at the proper distance for infinite to be in focus. Of course, that's hardly ever an option. Using an simple adapter for mounting the PK lens on the Nikon mount would probably add a few more mm, making that lens only work with close objects if you want to get them info focus.
There are adapters with correcting lenses, however, and they may work for this case. But they have their own limitations. They add more surfaces, thereby degrading image quality, and may be in the way of the lens tubus that sometimes reaches into the camera. And their diameter may not be large enough for a wide open lens like the one you wanted to use.
In all, this is a hopeless attempt. On the other hand, with a Sony alpha 7 model, you'd be in a better place - as those are mirror-less, despite being full-frame, their flange range is much shorter, allowing for adapters for many classic SLR lens mounts. But even those will have limit: Usually, those lens only function with manual aperture presets and may also not support open-aperture measuring due to both electrical and mechanical differences.