I always wondered what use the lensless M42 to Nikon AI adapters are, since they won't focus to infinity and are usually advertised as macro. But I had one turn up in a job lot of lenses a few days ago, and finally tried it tonight, with a Helios 44-2 (58mm f2). The result was interesting.
The mount is made of fairly thin metal and only adds about 1mm to flange depth. M42 should be 45.46 mm, Nikon is 46.50 mm, with the adapter say 47.5 to 48.0, so the actual extension with the adapter is only about 2-2.5mm. As a result the Helios focused perfectly out to two meters or so, which means it would be a pretty good portrait lens. The same should apply to most other M42 lenses, they'll work fine within 2M or so (the exact distance obviously depends on the lens - some badly adjusted lenses may even focus to infinity). Given that these things are ridiculously cheap I'd strongly recommend buying one in case an M42 lens comes your way and you want to use it.
No photos because the weather is lousy and my flat is a total mess at present.
This is a similar adapter on eBay UK - £1 shipped from China -
https://www.ebay.co.uk/itm/232517074055I think they're all pretty much alike.