Created
November 24, 2016 05:18
-
-
Save chimericdream/a97ac90dced1245c6546bf1db67ea52e to your computer and use it in GitHub Desktop.
Project Euler - Problem #28
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
21 22 23 24 25 | |
20 7 8 9 10 | |
19 6 1 2 11 | |
18 5 4 3 12 | |
17 16 15 14 13 |
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
$total = 1; | |
for ($i = 2; $i <= 1001; $i++) { | |
$total += ($i % 2) ? pow($i, 2) : 3 _ pow($i, 2) + 3; | |
} | |
echo $total; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment