Created
November 13, 2013 12:51
-
-
Save kazua/7448575 to your computer and use it in GitHub Desktop.
Project Euler Problem 30(PHP)
This file contains hidden or 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%2030 | |
| //write kazua | |
| for ($i = 2; $i < pow(9, 5) * 5; $i++) | |
| if (array_sum( | |
| array_map( | |
| function ($value) { | |
| return pow($value, 5); | |
| }, str_split($i))) === $i) | |
| $a[] = $i; | |
| echo array_sum($a); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment