Skip to content

Instantly share code, notes, and snippets.

@yuuki
Created August 7, 2012 07:50
Show Gist options
  • Save yuuki/3282921 to your computer and use it in GitHub Desktop.
Save yuuki/3282921 to your computer and use it in GitHub Desktop.
digits = Enumerator.new do |y|
n = 2**1000
while n > 0 do
y << n % 10
n /= 10
end
end
puts digits.inject(:+)
# 1366
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment