Rear derailleur does not shift onto sprockets 2 and 6 On a 3x7 gear 1990s Trek 800, the rear derailleur skips the second-smallest and second-largest cog, but goes into the smallest and largest ones. How to fix this? Shifting towards larger cogs, the derailleur puts the chain onto all cogs, but shifting away from the largest, both 1 and 2 on the indexed shifter keep the chain on the largest cog. Shifter 3 puts the chain on the third largest cog. Sometimes for smaller cogs the shifter number differs by 1 from the cog number (shifter 6 keeps it on 3rd smallest cog) but shifter 7 puts it on the smallest cog.
It may have been caused by my incompetent adjustment of cable tension after the derailleur started having difficulty going onto the largest cog.
Bike bought new, all original Shimano components, little used, kept in a garage. No rust. Haven't changed chain in decades but not much stretch (~1/16 inch per 12 inches).
Derailleur cable looks clean, no rust or dirt visible. No kinks or other visible problems. Rear derailleur pivots and hinges are moving freely. Pushing on each jockey wheel's edge moves the edge about 1mm. Not sure if that is too loose. No visible wear, unsurprisingly given the rest of the drivetrain is original and not that worn. Moving derailleur by hand or by cable pulling is easy - it goes into all the gears. As far as I can tell by eye, the derailleur is straight (both viewed from above and from behind). The 2-3 sections of the chain line up behind each other.
Looking for cheap or simple solutions first.
This sounds like a classic case of the shift cable hanging up in the housing. As the shifter releases cable increments to shift to smaller sprockets, the derailleur spring cannot pull the cable though the housing properly.
You can try removing, cleaning and lubricating  the cable. Replacing the cable and housing is the proper solution though, and is relatively inexpensive.
While you have the cable detached, check the derailleur itself is moving freely.