Sha256: f5d9cc6ce9ec884ef082c043c8ce43019df82bbfd5edde8c65682c4b7fd34d04
Contents?: true
Size: 269 Bytes
Versions: 211
Compression:
Stored size: 269 Bytes
Contents
<?php function factors($n) { $factorList = []; $limit = sqrt($n) * 10; for ($i = 2; $i <= $limit && $n > 1; $i++) { while ($n > 1 && $n % $i === 0) { $factorList[]=$i; $n = $n / $i; } } return $factorList; }
Version data entries
211 entries across 211 versions & 1 rubygems