<?php
function sp($a) {
$b = 1;
$suma = 0;
while ($b < $a) {
if ($a % $b == 0) {
$suma += $b;
}
$b += 1;
}
return $suma;
}
for ($i = 1, $max = 20000; $i <= $max; $i++) {
if (sp($i) == $i) {
echo $i."\n";
}
}
- Output for 5.4.5 - 5.4.11, 5.4.14, 5.4.16, 5.4.19 - 5.4.21, 5.4.25, 5.4.27, 5.4.29 - 5.4.31, 5.4.41 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.4, 7.4.6 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.24, 8.1.28, 8.2.0 - 8.2.11, 8.2.16 - 8.2.18, 8.3.3 - 8.3.6
- 6
28
496
8128
Process exited with code 137. - Output for 7.4.5, 8.1.25 - 8.1.27, 8.2.12 - 8.2.15, 8.3.0 - 8.3.2
- 6
28
496
8128
- Output for 5.4.2 - 5.4.4, 5.4.12 - 5.4.13, 5.4.15, 5.4.17 - 5.4.18, 5.4.22 - 5.4.24, 5.4.26, 5.4.28, 5.4.32 - 5.4.40
- 6
28
496
Process exited with code 137.
preferences:
178.26 ms | 403 KiB | 225 Q