Sen. Sam Nunn (D-Ga.) yesterday became the second influential senator in less than a week to accuse President Carter of flip-flopping unpredictably on national defense policy.

Carter, Nunn complained at a hearing of his Senate Armed Services manpower subcommittee, "has reversed his own course on national defense at least four times since last November" in declaring how much money was needed for the military.

In military pay specifically, Nunn continued, promises Carter made aboard the aircraft carrier Nimitz a week ago and his plans for fulfilling them turn out to be "one of the most imaginative uses of mathematics in my time on the Hill."

Nunn's complaints come atop an attack on Carter last week by Chairman Ernest F. Hollings (D-S.C.) of the Senate Budget Committee. Hollings charged it was "an act of hypocrisy" for the president to promise higher military compensation while aboard the aircraft carrier Nimitz, and then oppose a congressional budget resolution which would have provided extra defense money.

Sen. William S. Cohen of Maine, a Republican on Nunn's subcommittee, joined in the attack at yesterday's hearing, declaring Carter's policies for military compensation are "totally confusing" and confront Congress with "a maze of mirrors where it cannot distinguish between reflections."

Asked in a hallway interview to elaborate on Carter's flip-flops in defense budgeting, Nunn said the first big change came this January; a second change came in March; a third on May 15 when the president wrote Chairman John Stennis (D-Miss.) of the Senate Armed Services Committee urging him not to go along with the House additions in the Pentagon's procurement budget because it would take money from readiness accounts; a fourth time when he changed his mind about military compensation when addressing the Nimitz crew on May 26, and then when he opposed the congressional budget resolution for fiscal 1981, which would set a ceiling high enough to provide money needed for both readiness and extra compensation.

"You can say five times," Nunn chuckled. "I said at least four."

The Carter administration estimates that the package of military benefits the president promised while aboard the Nimitz would cost $1 billion in fiscal 1981.

Nunn complained repeatedly during yesterday's subcommittee hearing that the president's military budget only provides for $300 million of the promised $1 billion.

"Where's that $700 million coming from?" Nunn kept asking the Carter administration witness before him, Robert B. Pirie, assistant secretary of defense for manpower. "We need an explicit statement. Is he going to submit a supplemental?"

Pirie said the administration is still working out the details of the financing, adding that the final plan will depend in part on how the defense budget emerges from Congress. Administration officials have said that, if necessary, the Pentagon will offset the $700 million additional needed for compensation by making offsetting reductions in its budget.

The actions of promising the benefits without following up with a plan to finance them "are frankly baffling," Nunn told Pirie.

Cohen called the promise of more military compensation followed by the president's opposition to the first congressional budget resolution for fiscal 1981 "totally irreconcilable."

Although the committee did not go into it yesterday, the record indicates that Carter only came to the conclusion recently that the military should get more pay in selected, but not all, ranks and better medical, housing and other benefits.

In a Carter memo to Defense Secretary Harold Brown quoted by the Navy Times of March 17, and not denied by the White House when specifically asked about it, Carter said, "You should assess other factors involved in re-enlistment problems.When I was in the Navy pay was not the major factor" in deciding whether to stay in the service, Carter wrote Brown.

Abroad the Nimitz on May 26, Carter told the crew: "I understand and I'm committed to the principle that a career in the military should be as rewarding personally for those who serve as a career as any pursuit in the society that I represent.

"We will therefore ask that the Congress move without delay to appropriate compensation in addition to what's already provided to give you more help when you move from one location to another for reassignment; to provide more appropriate compensation for sea duty; to provide more compensation for flight duty; to provide compensation for housing in high-cost areas . . . and to provide more compensation for the re-enelistment bonuses of single career enlisted personnel," the president said.

Carter also promised to improve the military's medical program known as CHAMPUS, including dental care for children.

Nunn said yesterday that the CHAMPUS program has proven to be so inadequate to the needs of military people that he questioned whether it was worth sinking more money into the program.

Nunn also said that after studying military pay as subcommittee chairman he concludes that the system is "front loaded." The big raises, he said come during the first six years of a enlisted person's and officer's career and then go down to next to nothing.