示例#1
0
function q53()
{
    $count = 0;
    for ($n = 1; $n <= 100; ++$n) {
        for ($k = 0; $k <= $n; ++$k) {
            $numberOfCombinations = Math::combination($n, $k);
            if ($numberOfCombinations > 1000000) {
                ++$count;
            }
        }
    }
    return $count;
}
示例#2
0
<?php

use tomzx\ProjectEuler\Math;
require_once 'vendor/autoload.php';
echo Math::combination(40, 20);