Project Euler: Problem 16 in Ruby

Cake.

Problem #16

What is the sum of the digits of the number 2^(1000)?

n = 0

(2 ** 1000).to_s.scan(/./).each do |i|
  n += i.to_i
end

puts n