p={x->(2..1|x==2} f={x->(1..x).findAll({y->p(y)&'10'.every{p(Integer.toBinaryString(y).count(it))}})} [10,100,150,17].each{println f(it)}