John Robert Pasta, 62, who retired last month as director of the division of mathematical and computer sciences at the National Science Foundation, died of cancer Friday at Sibley Memorial Hospital. He lived in Washington.

Dr. Pasta was internationally recognized for his contributions to the design, development and application of computers.

A pioneer in developing techniques for solving physics problems by computer, he worked in this field, now know as experimental mathematics, with the Nobel Laureate physicist Enrico Fermi and Stanislaw Ulam, a mathematician, at the Los Alamos Scientific Laboratory in New Mexico, and with John von Newmann at the Institute for Advanced Study at Princeton University.

Dr. Pasta, who earned a doctorate in physics from New York University, was a member of the staff at Los Alamos during 1951-56, when he joined the Atomic Energy Commission and moved to the Washington area. He headed the AEC's mathematics and computer division until 1961.

From 1961 to 1970, he was professor of physics and head of the computer department of the University of ILLINOIS. As head of the university's Digital Computer Laboratory, he instituted a broad-based graduate program that attracted students from around the world.

Dr. Pasta joined the National Science Foundation in 1970. He headed the office of computing activities before becoming director of the division of computer research in 1974. The following year, the division was expanded to include mathematics.

In 1979, he was awarded the foundation's Distinguished Service Award.

A native of New York City and a former New York City policeman, he attended a special three-year high school there and graduated from the City College of New York.

During World War II, he served as a cryptologist and radar specialist for the Army in Europe, for which he received the Bronze Star. He was discharged in 1946 as a captain. Dr. Pasta was a research fellow at the Brookhaven National Laboratory for atomic research in Mississippi during 1948-51. He later served as a consultant to the laboratory's applied mathematics department and also was a consultant to industry.

A proponent of a mathematics institute, he recently saw the National Science Foundation approve two such institutes at Minnesota and at Berkeley, Calif. He served as an adjunct professor of engineering and applied sciences at George Washington University.

He was a longtime member of the AEC's mathematics and computer sciences research advisory committee and served as committee chairman during 1965-67.

He also was a U.S. delegate to the International Federation of Information Processing.

Dr. Pasta was the author of books and articles in his field and a member of a number of professional associations. He had served as an associate editor of the Journal of Computational Physics

Survivors include hiw wife, Betty, of Washington, a daughter Diane, of Seattle; a son, David of Palo Alto, Calif.; a brother, William, of El Reno, Okla., and a sister, Eleanor Kropilak of Brooklyn, Mich.