Skip to content

Instantly share code, notes, and snippets.

@mvw
Last active November 12, 2016 19:02
Show Gist options
  • Save mvw/d29dc8b4c42e8daa3b87b241ac7d525b to your computer and use it in GitHub Desktop.
Save mvw/d29dc8b4c42e8daa3b87b241ac7d525b to your computer and use it in GitHub Desktop.
# cubes56.rb
# http://math.stackexchange.com/q/2010848/86776
i = 0
(100..999).each do |n|
q = n**3
next if q % 100 != 56
i += 1
puts "#{i}: (#{n})**3 = #{q}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment