You're approaching the problem from the wrong point of view.
Smarty is used to display data, with a very limited set of instructions to manipulate them.
Since we're talking about logic here you should generate your random unique numbers elsewhere and then pass the result to the Smarty engine.
Therefore, assuming you're using PHP, try something like this:
$min = 1;
$max = 100;
$items_to_pick = 5;
$values = array();
for($i=$min; $i<= $max; ++$i){
$values[] = $i;
}
shuffle($values) //see PHP doc http://www.php.net/manual/en/function.shuffle.php
$result = array_slice($values, 0, $items_to_pick);
$smarty->assign('random_numbers', $result);
And in your template file:
{foreach from=$random_numbers item=random}
{$random}
{/foreach}
You should always try to separate content from presentation. Smarty shouldn't care about the values it's passed. (outside simple checks to see if you should display something or not, in my opinion)