Created
September 9, 2010 00:08
-
-
Save canweriotnow/571105 to your computer and use it in GitHub Desktop.
Solution to Euler problem 048
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
#!/usr/bin/ruby | |
sum = 0 | |
x = (1..1000).to_a | |
x.each do |n| | |
sum += n**n | |
end | |
puts sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment