Skip to content

Instantly share code, notes, and snippets.

@kazua
Created December 8, 2013 10:40
Show Gist options
  • Save kazua/7855719 to your computer and use it in GitHub Desktop.
Save kazua/7855719 to your computer and use it in GitHub Desktop.
Project Euler Problem 63(PHP)
<?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