Three weeks after surviving a coup attempt against his government, Thai Prime Minister Prem Tinsulanond is on a 17-day tour of the United States and Western Europe to repair Thailand's image abroad and reassure foreign investors about the country's stability. Signs indicate, however, that tensions in the military persist.

Prem left behind a raft of unanswered questions about the abortive rebellion. According to informed sources, the coup attempt involved more high-ranking military officers and caused more casualties than officially acknowledged so far.

Prem, who was out of the country when the coup attempt occurred Sept. 9, left Bangkok Tuesday for Honolulu. He is scheduled to address the U.N. General Assembly Monday, then meet Secretary of State George P. Shultz Wednesday and Defense Secretary Caspar W. Weinberger the following day.

Prem, who will also spend six days in Europe, is to meet the leaders of Britain, France and West Germany before returning to Bangkok Oct. 10.

The prime minister's trip has left elements of the military in turmoil over a police investigation of the coup attempt, Thai sources say.

Before leaving Bangkok, Prem cautioned against the use of "well-intended but unconstitutional means to solve national problems." In a televised speech, he said, "For those who recently tried to use force to bring about changes, the government will resort to the law as final judgment." He expressed hope that this would not create "divisions between the people, the civil service, the police and the military."

So far, police have arrested 39 suspected plotters, including former prime minister Kriangsak Chomanand, three other retired generals and the deputy supreme commander of the armed forces. The other detainees include Air Force and Army officers, seven labor leaders, a former guard at parliament and a university lecturer.

Police say warrants have been issued for 10 other suspects. Among them are Manoon Roopkachorn, a cashiered Army colonel who helped lead an abortive 1981 coup against Prem, and his brother Manas, an Air Force wing commander.

They were allowed to leave the country after 400 to 500 troops loyal to them surrendered to government forces Sept. 9. Manoon flew to West Germany via Singapore, and Manas was driven to the Thai-Burmese border. Also sought, and believed to be in hiding with Manas, is an Army captain who reportedly ordered rebel tanks to fire at Bangkok's 1st Army Division radio station, killing two foreign correspondents.

Authorities have said that five persons were killed and 59 wounded in the coup attempt, as rebels battled government forces with tanks, machine guns and mortars in Bangkok. But a police investigator told reporters unofficially that "at least 10" persons had been killed and "many more" than 59 wounded.

Authorities have identified one of the detained retired generals, Serm Na Nakhon, a former supreme commander and deputy prime minister under Kriangsak in the late 1970s, as the leader of the abortive coup.

However, according to a plotter who pulled out of the coup attempt, Kriangsak, Serm and the other retired generals were involved, but were not the instigators. Rather, he said, they were brought in as figureheads for a new government by Manoon and his powerful sponsors.

Others officially named as suspects, including the detained labor leaders and a fugitive operator of an illegal investment scheme, also are peripheral figures, according to the plotter and other sources.

Whether the investigation will lead to high-ranking military officers who withdrew from the coup plot at the last minute is a subject of considerable speculation here. But seemingly militating against it is an apparent closing of ranks in the armed forces, Thai analysts say.

Military rivals have made it a point to be seen in public with each other lately, and about 50 senior officers met last week to hear one of their number explain his role during the abortive coup.

According to the Bangkok Post newspaper, Lt. Gen. Pichit Kullavanich, the commander of the 1st Army Region, addressed the meeting to dispel "widespread rumors damaging to his reputation." Pichit insisted that he acted as a mediator between government forces and the rebels.

Another senior officer, deputy Army Commander Gen. Thienchai Sirisamphan, denounced what he called a smear campaign against certain ranking Army officers whom he did not identify. He said numerous leaflets had been distributed anonymously at Army units and press offices in Bangkok accusing two leading active officers of having plotted the Sept. 9 coup.

Kriangsak and two other detained former generals have been allowed to bring their own beds, television sets and other belongings to a special detention center, where meals have been catered to them from expensive restaurants. Another of the retired generals has been confined in a hospital for treatment of high blood pressure and hemorrhoids.