Added solution for ProjectEuler/025: php, ruby
This commit is contained in:
13
ProjectEuler/025/solve.php
Normal file
13
ProjectEuler/025/solve.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?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;
|
Reference in New Issue
Block a user