D.C. election officials said yesterday they knew before Tuesday's primary that the voter registration lists they were using did not contain the names of several thousand legitimate voters, but said they did not think the problem would be as extensive as it was.

Because of problems with the lists, about 20,000 voters -- including some candidates, top city officials and precinct workers -- were forced to cast special challenged ballots for which they had to sign an affidavit that they were a registered voter and fill out additional forms. About 17 percent of the 121,000 votes cast were on challenged ballots.

The officials said there was not enough time to correct the incomplete voter lists before the election, a problem that occurred when the D.C. Board of Elections and Ethics switched its registration rolls from one computer system to another earlier this year. The officials said they expect to rectify the problem in time for the Nov. 2 general election.

Election workers began the tedious task yesterday of examining the challenged ballots to see if they are valid. By law, the ballots must be validated, or invalidated, within six days of the election. The names of those voters whose ballots are invalidated must be published in a newspaper by next Monday and election officials said they would appear in that day's edition of The Washington Post.

Albert J. Beveridge III, the elections board chairman, said it would probably be next Wednesday or Thursday before the election results would be officially certified.

Both Beveridge and Teddy Filosofos, the board's executive director, said they felt problems with the election had been exaggerated by the media, contending that this election was relatively free of the administrative problems that have plagued prior elections, such as having an insufficient number of ballots and confusion at the polls.

"What people are forgetting is that this was the biggest election D.C. has ever had -- 121,000 people had the opportunity to vote. And 101,000 of them voted by merely signing a register," said Filosofos.

"This election showed that our basic [administrative] procedures are all right. But we still have a problem with our voter lists," Beveridge said. He added that the number of challenged ballots, "while much larger than it should have been, was nevertheless not unanticipated."

Election officials said the problem of names being left off the voter lists arose out of their efforts to try to correct errors that existed on the voter rolls used in last November's Board of Education election. A study done of that election revealed that about 50,000 names that should have been on the list had either been dropped or were inaccurate in some fashion.

When he took over last spring, Filosofos said he received a list of about 294,000 voters, compiled by workers from the GEICO insurance company, who were sent by that company to help the city straighten out the rolls. At that time, the city was using a computer system known as SHARE to produce its voter lists.

Filosofos said he ordered his staff to check the names on that computer list against the names listed in the board of elections' central card file and soon found the city had voter registration cards for about 30,000 residents who had never been entered into the SHARE system.

Filosofos said the SHARE listing contained so many informational errors -- about 5,000 residents were listed with no addresses -- that he decided in July to switch to a new, more sophisticated "minicomputer system," which is able to discern such errors. Although Filosofos apparently solved the computer problems, the elections staff was unable to correct all the errors the new computer system was finding.

Election officials said the new computer system rejected the names of about 50,000 voters because of errors in the voters' addresses and other factors. Election workers said they were able to correct about 40,000 of the mistakes before the primary.

The challenged ballots could have an effect on two close Democratic primary races for nomination to the City Council: In Ward 5, where Robert I. Artisst trailed incumbent William R. Spaulding by 579 votes, and in Ward 1, where Marie S. Nahikian was losing to school board member Frank Smith by 742 votes.