more comments
This commit is contained in:
parent
67503e8691
commit
cc3fbfc36a
20
euler25.php
20
euler25.php
|
@ -4,5 +4,23 @@
|
|||
* https://projecteuler.net/problem=25
|
||||
*/
|
||||
|
||||
//see https://fr.wikipedia.org/wiki/Suite_de_Fibonacci#Avec_la_formule_de_Binet
|
||||
echo intval((log(10)*999 + (log(5)/2) ) / log(1.61803398875)) +1;
|
||||
|
||||
echo intval((log(10)*999 + (log(5)/2) ) / log(1.61803398875)) +1;
|
||||
/*
|
||||
Very long solution that didn't test :
|
||||
|
||||
$i=1;
|
||||
$j=2;
|
||||
$count=2;
|
||||
while(strlen($i)<1000){
|
||||
$new=gmp_add($i,$j);
|
||||
$i=$j;
|
||||
$j=$new;
|
||||
$count++;
|
||||
}
|
||||
|
||||
|
||||
echo $count;
|
||||
|
||||
*/
|
Loading…
Reference in New Issue
Block a user