The Athenaeum portraits of George and Martha Washington will be shuttled back and forth between Washington and Boston -- spending three years in one city, then three years in the other -- if a Solomonic compromise, worked out in the last few days, is officially approved by all parties concerned.

The Smithsonian Institution's National Portrait Gallery and Boston's Museum of Fine Arts -- a pair of institutions which, like divorced parents, have spent more than a year fighting for custody of Gilbert Stuart's icons -- now seem to agree it is best that they take turns.

The deal is still tentative. It has yet to be approved by the boards of the museums, or by the Athenaeum -- the private Boston library which still owns the Stuarts -- or by the attorney general of the Commonwealth of Massachusetts. But sources in both cities said yesterday that they expect a settlement within two weeks.

It has been two years since the Athenaeum first offered the paintings to the National Portrait Gallery for $5 million. That deal, however, was put on hold last summer when a group of Massachusetts citizens, the Washingtons Belong in Boston Committee, mounted an SOS (for "Save Our Stuarts" fund-raising campagin. The committee hoped to raise the $5 million needed, but although it received some 300,00 contributions, its much-publicized campaign fell $4.5 million short.

Under the proposal now being considered, the Athenaeum would receive $4.85 million.

Boston would put up $2.1 million -- the $500,000 raised by the committee and an additional $1.6 million from the Museum of Fine Arts, where the Athenaeum pictures have long been on loan. The Smithsonian would provide $2.75 million.

Boston sources who wished to remain anonymous said the proposed deal was worked out principally by Howard Johnson, the Boston Museum's president. James Barr Ames, the Athenaeum's president, said yesterday he was aware of the proposal. "We hope to work something out where nobody would win, but everyone will win, if you see what I mean," he said.

One Boston source close to the museum said yesterday, "A deal appears likely, but obstacles remain. I'll name three: One, the museum doesn't have the $1.6 million it is supposed to spend. It will probably have to sell works of art from its collections to come up with the cash. Two: The attorney general, Francis X. Bellotti, may not approve the sale -- and I think he could block it. The third obstacle is Gen. James Gavin."

Gavin, the World War II paratrooper, was asked by the committee to lead their fund-raising campaign. "They didn't come up with the money. They figured that they'd done their best, and then threw in the towel -- but Gavin is a warrior," the source said. "He's still in the fight."

There are more than 20 people on the Boston Museum's board. Boston sources say that when they were asked to vote on their president's proposal, Gavin, a board member, pointedly abstained. When the six members of the board of the Commonwealth Cultural Preservation Trust, which was set up to control the money that came in from the SOS campaign, last month voted 5-1 to go along with Johnson's proposal, the general voted no.

Charles Blitzer, the Smithsonian's assistant secretary for history and art, said last night, "I know of no formal -- or informal -- agreement between the Portrait Gallery and the parties in Boston. But if a fair and sensible compromise is reached, I expect it would be approved."

Blitzer noted that in 1978, when the Athenaeum first offered the paintings to the Portrait Gallery, the Smithsonian offered to send the pictures back to Boston for one year in every five at no cost to the Museum of Fine Arts.

Marvin Sadik, the Portrait Gallery's director, was asked last night to comment on the proposed compromise. "The story is essentially true," he said.