Teddy Filosofos, executive director of the problem-plagued D.C. Board of Elections and Ethics since May, submitted his resignation yesterday, contending that city officials have hampered his efforts to clear up the board's longstanding administrative problems.

Filosofos said he believed the elections apparatus in the District of Columbia is tied too closely to politics -- the mayor appoints members of the elections board, who in turn appoint the elections director -- and suggested that the system be changed to offer the elections director more autonomy. He declined to elaborate specifically.

"It's not because I can't do the job," the 52-year-old Filosofos said of his resignation, which comes in the wake of widespread confusion at the polls in last Tuesday's primary election.

About 23,000 of the 124,000 D.C. residents who voted last week had to cast special ballots because their names did not appear on voter rolls.

Filosofos was hired to rectify a number of problems at the elections board, including the tangled voter rolls.

Filosofos gave his resignation letter to elections board chairman Albert J. Beveridge III at a 2 p.m. meeting yesterday. He said he intends to leave on Oct. 1, a month before the Nov. 2 general election.

"I think it would be terrible if Teddy left us," Beveridge said. "He made an extraordinary contribution . . . We need his professionalism." He said he and the two other elections board members still hope to persuade Filosofos to change his mind and remain here at least until the November election is over.

Filosofos said he would return to his previous job as deputy commissioner of elections for Erie County, N.Y. That job has been kept open for him, Erie County officials said yesterday.

Beveridge said Filosofos objected to pressure from Mayor Marion Barry that the board and Filosofos make certain that all of the 23,000 special ballots cast in the Sept. 14 primary be counted by yesterday.

Filosofos, maintaining that he could not do so without jeopardizing the integrity of the election, angrily walked out of a meeting last Friday at which Beveridge related the mayor's wishes. Barry, who was nominated to run for a second term in the primary, is taking a week off and could not be reached for comment. City Administrator Elijah B. Rogers said he was unaware of Filosofos' resignation and declined comment.

The board yesterday completed counting the special ballots in the two most closely contested ward primary elections. In Ward 1, the board reported that school board member Frank Smith, who led in last Tuesday's Democratic primary for that ward's City Council seat by about 740 votes, had increased his lead over his closest challenger, housing activist Marie Nahikian. Yesterday's results showed Smith with 5,111 votes to Nahikian's 4,268.

In Ward 5, the board said a final count of all ballots showed incumbent William Spaulding the winner with 5,303 votes to 4,590 for Robert A. Artisst.

Beveridge said Barry wanted the special challenged ballots counted quickly because "the longer we delay the vote count, the worse the public perception." Filosofos won out, and only the special ballots for Wards 1 and 5 were scheduled to be counted yesterday. By late yesterday, there were no results from the Ward 5 count. Ballots from the other wards should be completed by Friday, Beveridge said.

In recent weeks, Filosofos had complained bitterly that some employes at the elections board had not followed directives he gave them and set back the progress he was trying to make in correcting errors on the city's voter registration rolls.

He said he fired two employes who were working in the board's computer division. Filosofos said a third employe walked out when he asked about a box full of voter registration cards that he said he found under the employe's desk.

Beveridge said Filosofos was disappointed over public reaction to problems in last week's primary.

"There was very little understanding of what he has done personally" to correct the problems, Beveridge said. Beveridge listed among Filosofos' accomplishments the fact that he had elections employes check the city's voter rolls against the original cards that a voter turns in when registering. In that way, Beveridge said, Filosofos said that about 30,000 voters were in the card file but not on the voter lists used at polling places.

Filosofos was criticized because some of the names the elections board placed on the list were of voters who no longer lived in the city or who had died. Beveridge said that under current law, Filosofos was prohibited from purging these names from the voter rolls unless he was able to certify that the person had not voted in the District of Columbia for more than four years.

Beveridge also credited Filosofos with transferring the city's voter rolls from one computer system to another, which elections officials describe as more sophisticated. In that transfer, about 10,000 names were dropped from computerized voter registration lists used in Tuesday's primary.