Tout est dans le titre :)
C'est simple mais assez utile ;)
J'ai commencé par creer cette fonction qui est trop lourde en calucl :
function nDuel($nombre){
$list = array();
$start = 1;
$val = 0;
if($nombre >= 2){
do{
for($i=$nombre;$i>=$start;$i--){
for($y=$start;$y<=$nombre;$y++){
if(
!in_array("$i/$y",$list)
and !in_array("$y/$i",$list)
and $i != $y
){
$list[] = "$i/$y";
}
}
}
$start ++;
}while($start != $nombre);
$val = count($list);
}
return $val;
}
puis j'ai compris que c'était plus simple :)
Donc Voila !