Created
December 8, 2013 10:40
-
-
Save kazua/7855719 to your computer and use it in GitHub Desktop.
Project Euler Problem 63(PHP)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%2063 | |
//write kazua | |
$a = array_sum( | |
array_map( | |
function ($value) { | |
if (log(10 / $value) != 0) $r = (int) (log(10) / log(10 / $value)); | |
else $r = 0; | |
return $r; | |
}, | |
range(1, 10) | |
) | |
); | |
echo $a; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment