Arthur M. Okun, 51, one of the nation's foremost economists and a former chairman of the Council of Economic Advisers under President Lyndon B. Johnson, died here yesterday after a heart attack.

After being stricken in the garden of his home in the District, Dr. Okun was taken to Georgetown University Hospital where he died.

Both in the government and afterward at the Brookings Institution, where he had worked since 1969, Dr. Okun devoted his widely renowned imagination and insight to tackling the major problems of the nation's economy. i

At the same time of his death, he had almost completed what he considered one of his principal contributions to economics, an analysis of the so-called "stagflation" that he saw as the nation's greatest single economic hazard.

Known for his prolific innovation as well as his mathematical gifts, Dr. Okun advanced many proposals throughout the years for grappling with stagflation -- the dual problem of rising inflation and rising unemployment.

Admired for his ability to bring scholarly rigor to bear on many problems of practical relevance, Dr. Okun was famed within the profession of economics for his formulaton of what is known as Okun's Law.

This doctrine provided a mathematical relationship between unemployment and productivity, specifying the amount of increase in the latter for every percentage point of decrease in the former. The law was of great value in econoic analysis and forecasting.

Dr. Okun, a Jersey City native who became the youngest man to head the Council of Economic Advisers, began at an early age to demonstrate the abilities that won him honors and awards throughout his career.

In 1949 while he was at Columbia University, Life magazine nominated him as one of that year's college seniors most likely to succeed.

It was a sound prediction, applied to a man known to his colleagues for being a "shark with numbers," and possesing a "steel-trap mind." A member of Phi Beta Kappa, the bespectacled, pipe-smoking economist graduated from Colubmia with honors and special distinction in his field, and with the prize for the highest academic average in his class.

While working for his PhD at Columbia, he began teaching at Yale. While climbing the ladder of faculty advancement there, he was drafted by Dr. James Tobin, an older colleague, to come to Washington to join the staff of the Council of Economic Advisers.

Tobin, himself one of the nation's leading economists, Sterling Professor of Economics at Yale and a former member of the council, called Okun last night "about the smartest and most brilliant and insightful economist I've known."

After reaching the rank of full profoessor at Yale in 1963, Dr.Okunm became a member of the Council of Economic Advisers the next year, and the council's chairman -- the president's chief economic adivser -- in 1968. At the end of the Johson administration, he joined Brookings.He has also served as a consultant to the American Security & Turst Co. here and to Donaldson, Lufkin & Jenrett in New York.

Economists knew Dr. Okun as a significant contributor to the fields of macroeconomics, to both monetary and fiscal policy and in particular to the debate surrounding means of stabilizing prices and wages.

Although not considered an ideologue, he was regarded generally as Keynesian in outlook, a believer in the doctrine that fiscal policy, which affects the spending of money, should be emphasized over monetary policy, which affects its supply.

Concerned in particular with the problem of infaltion, he was regarded as a major contributor to what economists call incomes policy and to the development of techniques for carrying it out.

Incomes policy calls on the government to try to encourage business and labor to moderate prices and wages as a means of restraining inflation.

In recent work he had been developing a system for holding down wages and prices through controls that would neither be oppressively rigid nor totally lacking in rewards for compliance and penalties for violation.

As an advocate of the use of some form of guidelines for wages and prices, he also was active in working out plans to use taxation to encourage compliance.

A witty man who made vivid the abstruse, his ideas won wide currency and respect among members of both political parties through his personal contacts as well as through the speeches he gave and the books and papers he published.

He was coeditor since 1970 of "Brookings Papers on Economic Activity," a journal of research publications on national economic issues, and was editor of "The Battle Against Unemployment." Among his books were "The Political Economy of Prosperity' (1970) and "Equality and Efficiency: The Big Tradeoff" (1975).

Some saw the latter work as indicative of a movement away from the liberalism of his earlier days. In the book, he suggested that equality and efficiency might come to replace unemployment and inflation as the opposing poles of economic policy.

Part of his study of stagflation involved its effects on Okun's Law. The Law required an increase in Gross National Product to accompany a decrease in unemployment. The recent breakdown of this relationship has perplexed economists, and Dr. Okun was trying to find out what went wrong.

His death was widely mourned in the econmic community as a severe loss.

"He really understood what was going on in the economy," said Dr. Joseph A. Pechman, director of economic studies at Brookings. "People of all . . . persuasions regarded him as one of the nation's outstanding economists."

Survivors include his wife Suzanne, and three sons, Lewis, Matthew and Steven, all of Washington.