Virginia delegates to the Democratic National Convention, which opens in New York City Monday, would do well to remember a little mathematics lesson from state Sen. Joseph V. Gartlan Jr.

An accountant, Gartlan told a meeting of Fairfax County Democrats, will say without hesitation that two plus two plus two equals four. But a politician, he noted, will always ask, "What do you want it to be?"

Even though the joke was intended as a playful slap at the political maneuvering sure to accompany next year's legislative reapportionment, Gartlan's humorous warning could easily be applied to the upcoming battle among democrats at Madison Square Garden.

On the basis of numbers, Jimmy Carter has more than enough votes to win renomination. If delegates stay in line and vote the way they said they would during the primary season, Carter will wallop his only announced party rival, Sen. Edward M. Kennedy.

But Carter -- beset by economic, foreign policy and "Billy" woes -- could very well get walloped in November by Republican Ronald Reagan. That prospect has some Democrats nervously looking for a way to open up the national convention to a winner -- someone other than Carter or Kennedy.

So far, the controversy over an open convention has had little impact on Virginia's 64 delegates. Carter dominates the delegation, with 59 delegates pledged to the president, compared with five pledged to Kennedy.

A few Carter people say the president could use the "fresh mandate" of being nominated by unpledged delegates and say they would support an open convention. But none of the Virginia delegates for Carter have even hinted that they might switch their vote to another candidate if given the chance.

"I'm still holding tight," says Margo Horner, a Carter delegate from Arlington. "I was expecting to get a few calls from 10th District Democrats with views about the open convention issue, but I haven't had them."

Horner is one of 13 delegates from Northern Virginia, including five delegates each from the 8th and 10th congressional districts, (six for Carter and four for Kennedy). Lt. Gov. Charles S. Robb, who lives in CLean, is among three Northern Virginians elected as at-large delegates at the Democrarts' state convention in June. All three are pledged to Carter.

With the state party's top officials solidly in the Carter camp, most Virginia Delegates say they will be watching the action in other delegations for signs of how Carter is doing.

"We're so far down in the alphabet that by the time they get to us (on convention votes), the question has already been decided," laughs Senate Majority Leader Hunter B. Andrews, of Hampton, a Carter delegate.

Despite his unwavering support for the president, Andrews notes that some state politicians are privately thankful that statewide and General Assembly elections are held in nonpresidential years -- thus those candidates don't have worry about being linked to what may be as sinking national ticket.

But there are congressional elections this year, and in Northern Virginia's 8th and 10th districts, both the incumbents are Democrats.

Joseph L. Fisher, congressman from the 10th District, has expressed his support for the president often. He contends that the "open convention" label is a misnomer since convention delegates were chosen in an open process in the first place.

Harris, who assiduously avoids mentioning Carter in public appearances, endorsed the president last February, but now is touting Vice President Mondale as a possible replacement. Last week, Harris said he supported the open convention concept even though he was disassociating himself from a "dump Carter" movement.

But Harris, who is not a convention delegate, was careful to point out the obvious: The decision on whether to release the delegates must come from the delegates themselves. And it doesn't take long to figure that most of those who will be be voting on the issue are Carter supporters.

In the end, Harris note, how a member of Congress feels on the issue won't matter much, eventhough congressional candidates have the most to fear from a faltering national ticket.

Most of those drawn into the tug-of-war over an open convention have been from Northern Virginia, which gave Kennedy four of his five Virginia delegates.

Fairfax County Democrats got a taste of the debate at a county committee meeting last week. Committee members had gathered at John Marshall High School for a routine session, but immediately were caught up in a debate over a resolution endorsing an open convention.

Harris had backed the same proposal earlier in the day, a move that startled and angered several Carter supporters.

"All of my liberal friends are now willing to just dump overboard the decision that 51 percent of 19 million Americans have made in the Democratic primaries," complained Fairfax Senator Gartlan.

Ray Colley, chairman of the 8th District Democratic Committee and a member of the party's national rules committee, contended than an open convention would disenfranchise thousands of area voters who turned out last March to express their preference for a presidential nominee.

"Every delegate signed a form pledging to support either Senator Kennedy or President Carter," Colley said. "The only way we could know if the will of the people has changed since then would be to run this process again."

Thomas Patton, of McLean, sponsored the open convention resolution, which passed by only six votes. Although Patton is a Kennedy supporter, he said the move for an open convention "rises above any particular presidential candidate."

He argued that delegates should be released from pledges to support specific candidates because circumstances had changed since they were first chosen.

If the party refuses to give delegates the option of voting their consciences, Patton contended, it will raise serious questions about "whether the national convention could survive a meaningful assembly."

The open convention showdown does promise to provide the American public with better entertainment than the carefully stage-managed Republican Convention that nominated Ronald Reagan.

But it is unlikely that the outcome will be much different. Jimmy Carter is ahead in the delegate count -- he now has 1,981 of the 3,331 votes -- and he is expected to stay ahead barring a major development in the next few days.

One thing that may keep the delegates from experimenting with the "new math" described by Gartlan is a concern for how it will look to American voters.

"It the Democrats do anything in a hasty way," cautioned Jean McDonald, an aide to Congressman Fisher, "it will look a lot worse than having a president who's down in the polls."