Skip to content

Instantly share code, notes, and snippets.

@kazua
Created November 13, 2013 12:51
Show Gist options
  • Save kazua/7448575 to your computer and use it in GitHub Desktop.
Save kazua/7448575 to your computer and use it in GitHub Desktop.
Project Euler Problem 30(PHP)
<?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