f={Long.toBinaryString(it).size()}[1,2,3,4,7,8,15,16,128,4294967295].each{println f(it)}
Standard input is empty
1 2 2 3 3 4 4 5 8 32
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!