My camera is a Nikon D3400. I got a Vivitar 34-70 mm Macro lens. I tried to mount it on my camera and failed. Can I buy a adapter?
This lens has an Olympus OM mount. From West Yorkshire Cameras's 35mm SLR Lens Mount Identification Guide,
This is an easy one. Any OM mount lens will have two rectangular, spring loaded buttons directly opposite-ish each other. That’s the easiest way to visually identify an OM mount lens, as no other lens mount shares this. Any Olympus OM lens fits any Olympus OM camera with no problems.
Olympus OM lens mount. From wycameras.com
Regarding adapting OM-mount lenses to F-mount camera bodies (the Nikon DSLR mount is called "F-mount"), it is possible to physically mount the lens to the camera body, and adapters are available. However, the exact distance from the lens to the camera sensor is a critical dimension, called the flange focal distance, also known as registration distance. This distance differs between mount types. The Nikon F-mount has a 46.5 mm flange distance; the Olympus OM mount has a 46.0 mm flange distance — only 0.5 mm difference between the two mounts. But that half millimeter is very important.
But more importantly, the mechanical mating of bayonet flanges is completely different between the two camera systems, so an adapter will add several millimeters between the lens and camera body. Unless corrected for with extra optics in the adapter, this extra distance will prevent the adapted lens from focusing on far objects. Whether this is an issue is up to you; this is a so-called "macro" lens (perhaps in name only, its maximum magnification is likely 1:10, which is nowhere near what we would normally consider "macro"). So if your only intent is close-up work, maybe the inability to focus beyond a few meters is not a problem.
I mentioned that OM lens to F-mount body adapters do exist (just search for that term, it'll pop up), and have the corrective glass in them to allow the lens to focus at infinity. The corrective element in most of these adapters isn't the highest quality glass, which might reduce your image quality. Again, it's up to you to determine if that is a problem or not.
Another note: if the rear element of your lens protrudes beyond the flange at any zoom or focus setting (most likely at or near closest focus), be careful that the rear element does not come in contact with the adapter's corrective element.
For more information, see: Can I use lens brand X on interchangeable lens camera brand Y?