Paying 100 caps (or 50 depending on the player's funds).
Convincing the mercenaries to leave with a Speech skill of 30.
Convincing them to leave by choosing these dialogue options (no skill checks required):
"Are you deserters?"
"I guess I can understand that."
"Why not just turn yourselves in?"
"I imagine the NCR doesn't deal with deserters kindly."
"It would be safer to run and find someplace to hide."
Detailed walkthrough
After bringing back order to the town Primm, the player must travel to a different location, like Goodsprings or Boulder City. The player must pass three days without visiting Primm. Once this is done, visit Primm's Vikki and Vance Casino. After roughly 10 seconds, the player will be approached by Layla and her band of thugs, who heard Primm is ripe for the picking. A conversation with Layla will reveal that they are NCR deserters driven off by the news of the Legion's increasing presence in the other side of the river, and had turned to raiding after losing all their money gambling. There are three possible ways to get rid of them:
Convince them that there is law back in Primm with a Speech skill of 30.
Pay them off with 100 caps, or 50 caps depending on your funds.
Fight them.
After they are gone, the Vikki and Vance Casino will open up again and will resume functioning as a normal casino.
Notes
During conversation with the player, Layla mentions that she and the other deserters will head to New Canaan.
After dealing with the group, it is a good time to loot everything in the casino since no one else will be inside it until you leave and return.
If you convince them to leave without attacking them or paying them some of the loot will not be considered stealing.