예제 #1
0
파일: 53.php 프로젝트: tomzx/project-euler
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
파일: 15.php 프로젝트: tomzx/project-euler
<?php

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