Not since Anwar Sadat's funeral have America's three living ex-presidents assembled together, but last night at a dinner for Adm. Hyman G. Rickover they regrouped in a standard Washington formation that was--where else?--at the head of a receiving line. It went on for what seemed as long as the 1980 election campaign, although it was really an hour.

"Gretchen! Gretchen!" Jimmy Carter called out to former White House social secretary Gretchen Posten midway through. "Move along the line!"

"Close it off!" Gerald Ford called out at 7:55 p.m. And at 8, they did.

But not before Richard Nixon had told former Carter pollster Pat Caddell that "your pictures don't do you justice." He also asked former Carter press secretary Jody Powell, jokingly, "Are you as mean as you always were?"

"Yes," said Powell's wife Nan, in a gracious deadpan.

Rickover, an eccentric genius prone to temper tantrums and grueling interrogations of Navy officers, is commonly referred to as the father of the nuclear Navy. The dinner was the work of friends who thought the 83-year-old admiral, involuntarily retired by President Reagan last year, deserved a tribute.

"I do not deserve to be singled out for accolades," Rickover said in his speech. "I do not believe I have done enough for my country. I did what I wanted and I was paid well for my work. And I obeyed all orders that I agreed with." This got a lot of applause.

The dinner was held at the Sheraton-Washington Hotel, where more than 500 people had lumps of filet mignon and a dessert entitled the "Rickover Chocolate Submarine Bombe." It was also a kickoff for the new Rickover Foundation, an organization that will, among other things, provide scholarships and fellowships and hold conferences on energy.

Ronald Reagan, who was in California, did not send a representative or a telegram. Guests who did come included former defense secretary James Schlesinger, Virginia Gov. Charles Robb, Sens. William Proxmire (D-Wis.), Henry (Scoop) Jackson (D-Wash.) and Strom Thurmond (R-S.C.) and former secretary of state Alexander M. Haig. "He's earned a good rest, and he's 83," said Haig. "I hope I'm as relaxed by then."

Although Rickover did say: "Admirals never die, and they do not fade away."

Tickets for the black-tie dinner went for $1,000 a plate. Some of them weren't easy to sell because of a Democrats-for-the-'80s dinner across town and the 2 1/2-hour, final episode of the television show "M*A*S*H*". In fact, "M*A*S*H*" had caused Carter to worry privately about the turnout.

Sen. John Warner (R-Va.), who introduced Ford, told a story from the podium about a "good Navy wife" who told him, " 'Well, only for Admiral Rickover would I give up 'M*A*S*H*' tonight on TV.' And that gave me an idea," Warner continued. "I called the producers of 'M*A*S*H*' and said, 'Why don't you run a sequel--interviews by Rickover? And you know, they bought it. Because they don't have to change the title. They can call it 'M*A*S*H* II.' "

Rickover, who as director of the Navy's Nuclear Propulsion Program had the sort of power and friends on Capitol Hill that made presidents think twice before crossing him, also said in his speech last night that "for those who consider me stubborn, let me tell you I started early. At the age of 4, I was deathly sick. The doctor had to break my teeth to force medicine down my throat."

Each ex-president got to make a speech. Carter was first, and said that Rickover, "second only to my own father, had a great impact on my life." Ford, speaking for himself and his fellow ex-presidents, said he admired a man who could "achieve a rank far greater than any of us." Then he paused. "And a man who could hold an office far, far longer than any of us."

Nixon was last. "Two or three weeks ago I had a very traumatic experience," he said. "I became 70 years of age. And on that occasion I was thinking about the future. And I got a little bit depressed . . . but I looked to Admiral Rickover, and I had a little bit of hope."

Much of Rickover's speech detailed his childhood as a Jewish immigrant from Poland, which was at that time a part of Russia. He recounted how he couldn't attend public schools in Poland because he was Jewish and told how he traveled in a canvas-covered wagon to the border between Poland and Germany. "We came to the border at night," he said. "My mother and sister walked across; I was carried on the guide's back."

His father was already in the United States. When Rickover and his mother and sister got to Ellis Island--Rickover said the immigration authorities didn't tell his father they were there--the family was almost sent back. But a man who was a friend of the family got the word to his father. "During my naval career," Rickover said, "many contractors have probably cursed the man who reported my arrival and thus prevented my being shipped back to Poland."

During the dinner, one of the best things to watch was former presidents Nixon, Ford and Carter on the dais. They chatted amiably, all three of them kicked out from the most exclusive men's club in the world. They seemed to eat heartily. Ford, who sat between Nixon and Carter, talked most intensely to Nixon. Carter was generally left out, but appeared perfectly happy talking to Joann DiGennaro, the director of the Rickover Foundation and one of the evening's organizers.

Before the dinner, the three presidents talked for half an hour in one of the hotel's suites. Nixon reportedly told jokes and Carter and Ford presumably laughed. "They didn't make any plans to get together again," said David Rubenstein, Rickover's lawyer and an organizer of the dinner, "but I think they all respect each other."

None of the ex-presidents revealed what else went on in the room, although Carter said "we talked about long receiving lines." Carter, a disciple of Rickover's, also said he had "no comment" on Reagan's decision to retire Rickover.

As for Nixon, he didn't have much to say at all. When one reporter asked to speak with him, Nixon replied with a resounding "No."