aboutsummaryrefslogtreecommitdiff
path: root/challenge-109/brtastic/php/ch-1.php
blob: cc5c5e6de38488ea2a38aad6400060608fda8dce (plain)
1
2
3
4
5
6
7
8
<?php

foreach(range(1, 20) as $num) {
	echo array_sum(array_filter(
		$num >= 4 ? range(2, floor($num / 2)) : [],
		fn ($divisor) => $num % $divisor == 0
	)) . "\n";
}