An ailing Soviet mathematician who fought for nine years to emigrate to the United States for medical treatment arrived here with his wife Saturday aboard U.S. industrialist Armand Hammer's private jet.

Benjamin Charny, 50, whose emigration had been blocked by Soviet officials who claimed he was privy to state secrets, was met at Logan International Airport by family members and U.S. political figures who worked for his release."I can tell you that I'm infinitely grateful to Mr. Hammer that brought me to you as a magician in a fairy tale," Charny said.

Hammer, who said he had appealed directly to Soviet leader Mikhail Gorbachev on Charny's behalf, said, "This has been a difficult case. I feel it has been a privilege for me to assist.

"I think it's another example of the improving relations between our countries," said the 89-year-old chairman of Occidental Petroleum Corp. Hammer's friendly ties to the Soviet Union go back to Vladimir Lenin.

Charny and his wife Yadviga, 52, a metallurgist, plan to rejoin their daughter, Anna Charny-Blank, who lives in Brookline. His younger brother, Leon, a Massachusetts Institute of Technology doctoral student, lives in Needham.

Charny, a mathematician who from 1966 to 1971 helped calculate the re-entry orbits of Soviet space probes sent to the moon and Mars, lost his job in 1977 when he applied for an exit visa.

During the U.S-Soviet summit in Moscow last May, Charny met with President Reagan during a gathering of prominent refuseniks at the American embassy.

Charny, who walked off the plane on his own, has undergone surgery for a cancerous tumour on his back and has what is believed to be benign tumor on his neck that must be removed. He recently suffered a heart attack, leaving Soviet physicians reluctant to operate on the neck tumor for fear his heart was too weak.

In 1986, the New England Medical Center offered Charny free treatment. Leslie Fuhrer, a spokesman for the center, said Charny will be examined Monday by a cardiologist.

"We don't really know what's wrong until we examine him ourselves," Fuhrer said.

Charny's release resolves one of the best-known refusenik cases.

Beginning last year, Soviet officials increased Jewish emigration and have granted most well-known refuseniks exit visas. But Jewish activists assert thousands who have not attracted western media attention remain behind.

Among those who met Charny on his arrival were U.S. Sens. Edward M. Kennedy and John Kerry, D-Mass., and Kitty Dukakis, the wife of Democratic presidential candidate Michael Dukakis.

During the first five months of 1988, the Intergovernmental Committee for Migration in Geneva reported, 4,574 Jews have been allowed to emigrate from the Soviet Union.

More than 8,000 Jews were allowed to leave last year, a sharp increase from previous years but far below the peak of more than 51,000 in 1979.