Created
January 1, 2019 23:26
-
-
Save kenprice/c87e0639bb12b740441687d080df0bff 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
sumDiag :: Int -> Int | |
sumDiag 0 = 1 | |
sumDiag x = | |
sumDiag (x-1) + (4 * x') - (12 * x) | |
where x' = ((x * 2) + 1) ^ 2 | |
main :: IO() | |
main = putStrLn (show (sumDiag 500)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment