Files
  • main.rb
main.rb
1
2
3
4
5
6
fn=
->n{eval ("0b%b"%n).squeeze ?0}

[1,9,15,13,16,17,65535,65000].each do |i|
  p fn[i]
end
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]