From 05f6ddc8972e5227ec2d7d8c44da3b8024925eb3 Mon Sep 17 00:00:00 2001 From: Gnieark Date: Sat, 21 Nov 2015 13:25:47 +0100 Subject: [PATCH] fix --- _functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/_functions.php b/_functions.php index e25018a..613f15c 100644 --- a/_functions.php +++ b/_functions.php @@ -39,12 +39,15 @@ function getPrimeNumber($order){ } return $i-2; } + function getAllDivisors($n){ $divisors=array(1); for($i=2;$i<=sqrt($n);$i++){ if(fmod($n,$i)==0){ $divisors[]=$i; - $divisors[]=$n/$i; + if($i <> $n/$i){ + $divisors[]=$n/$i; + } } } return $divisors;