Skip to content

Instantly share code, notes, and snippets.

@canweriotnow
Created September 9, 2010 00:08
Show Gist options
  • Save canweriotnow/571105 to your computer and use it in GitHub Desktop.
Save canweriotnow/571105 to your computer and use it in GitHub Desktop.
Solution to Euler problem 048
#!/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