A design error that led to the shutdown of five nuclear plants this week was known to the Nuclear Regulatory Commission five years ago, a group of scientists critical of nuclear power charged yesterday.

The Union of Concerned Scientists, a Boston-based organization, told Senate subcommittee hearings on the shutdowns that a December 1974 regulatory guide ordered changes in the formula so as to correct the error. The old formula, drawn up by Stone and Webster Engineering Corp. of Boston, has contained mathematical flaws that could have left auxiliary pipeline systems vulnerable to earth-quake damage.

The NRC closed the five plants -- one each in New York, Maine and Pennsylvania, and two in Virginia -- this week pending an evaluation of the problem in each one and the completion of any needed repairs. The closure could last "some months" and may cost the five plants' estimated 13 million consumers as much as $2 millon each day to replace the nuclear fuel with oil, officials testified.

UCS head Daniel F. Ford said the regulatory commission was "grossly negligent" in allowing the five plants to be licensed in the first place. He said that when the NRC corrected the design error for plants entering construction after 1974, it had been "avoding the question of what to do about plants already operating or under construction."

NRC officials and the head of Stone & Webster both responded that the change had occurred during regular upgrading of nuclear power plant design and that no one had noticed until last week that any error had been made.

Stone & Webster supplied the design formulas and "we said fine, that sounds like an accredited kind of code," NRC regulation director Harold Denton was quoted as telling the commission this week. "At the time," he said yesterday, "we did not verify that there were not numerical errors buried in the code somewhere." Such errors are caught now, he added.

William F. Allen Jr., head of Stone & Webster, said he thought the NRC had "overreacted" in shutting the five plants down. Even though the pipe design may not meet the requirement, he said, "we remain convinced that these [safety] systems will not suffer a loss of function" in an earthquake.

The old, faulty formula, he said, was not strictly in error but only "gives a less conservative result" than the new one. Denton explained later that the old formula subtracted the vertical stress of an earthquake from the horizontal stress instead of adding them together. "It is an error that would not have been acceptable if we had seem it at the time," he said, "and it is not acceptable now."

Sen. Edmund Muskie (D-Maine) told the panel that his constituents were making "tremendous expressions of outrage" over the prospect of higher electricity bills, "and frankly I don't blame them." He read a statement from the Maine Yankee Power Co., operators of one of the shut plants, asking the NRC to reconsider its action.

"Maine residents... feel they are making a major economic sacrifice for the sake of a bureaucratic regulation," he said.

The Union of Concerned Scientists, having attacked the nuclear regulatory commissioners previously, this time rushed to their defense.

"I'm disappointed that the very first time they take an action of the type they should have been taking for the last 20 years, you haul them down here to explain themselves," said former NRC engineer Robert Pollard, now with the UCS Washington office.

Anthony Roisman, attorney for the Natural Resources Defense Council, said the NRC "should be given every support for their action" in order to avoid the chance of being "scared from doing this again" by political and economic considerations.

"Every plant that is licensed has built into it the potential for the precise shutdown you're considering here," Roisman said, since all the nation's 72 nuclear plants were built with what the NRC calls 41 major safety issues still unresolved.