From cc3fbfc36a4470c1e9d3eb5c0019f75a622da789 Mon Sep 17 00:00:00 2001 From: gnieark Date: Sun, 22 Nov 2015 22:16:01 +0100 Subject: [PATCH] more comments --- euler25.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/euler25.php b/euler25.php index 939be81..06e56ca 100644 --- a/euler25.php +++ b/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; \ No newline at end of file +/* +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; + +*/ \ No newline at end of file