fork download
  1. p={x->(2..<x).every{x%it!=0}&x>1|x==2}
  2. f={x->(1..x).findAll({y->p(y)&'10'.every{p(Integer.toBinaryString(y).count(it))}})}
  3. [10,100,150,17].each{println f(it)}
Success #stdin #stdout 0.64s 333376KB
stdin
Standard input is empty
stdout
[]
[17, 19, 37, 41, 79]
[17, 19, 37, 41, 79, 103, 107, 109, 131, 137]
[17]