Skip to content

Instantly share code, notes, and snippets.

@edymerchk
Created March 31, 2015 04:46
Show Gist options
  • Save edymerchk/1e8dd4352b9269dba4cd to your computer and use it in GitHub Desktop.
Save edymerchk/1e8dd4352b9269dba4cd to your computer and use it in GitHub Desktop.
# abc=a^3+b^3+c^3
i = 0
max = 999
while i <=999
puts i.to_s.rjust(3,'0') if i == ((i /100) ** 3) + ((i % 100 / 10) ** 3) + ((i % 10) ** 3)
i +=1
end
=>
000
001
153
370
371
407
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment