codingtests/solutions/ProjectEuler/025/solve.php
2024-07-01 13:49:44 +00:00

13 lines
206 B
PHP

<?php
define('DIGITS',1000);
$current = 1;
$prev = 1;
$term = 2;
while(strlen($current) < DIGITS) {
$term++;
$next = bcadd($current,$prev);
$prev = $current;
$current = $next;
}
echo $term;