A   pernicious number   is a positive integer whose   population count   is a prime.

The   population count   is the number of   ones   in the binary representation of a non-negative integer.



Example
22   (which is   10110   in binary)   has a population count of   3,   which is prime,   and therefore

22   is a pernicious number.



Task
 display the first   25   pernicious numbers   (in decimal).
 display all pernicious numbers between   888,888,877   and   888,888,888   (inclusive).
 display each list of integers on one line   (which may or may not include a title).


See also
 Sequence   A052294 pernicious numbers on The On-Line Encyclopedia of Integer Sequences.
 Rosetta Code entry   population count, evil numbers, odious numbers.


with javascript_semantics
function pernicious(integer n)
    return is_prime(sum(int_to_bits(n,32)))
end function
 
sequence s = {}
integer n = 1
while length(s)<25 do
    if pernicious(n) then
        s &= n
    end if
    n += 1
end while
pp(s)
s = {}
for i=888_888_877 to 888_888_888 do
    if pernicious(i) then
        s &= i
    end if
end for
pp(s)
