user
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.
assistant
(formerly Perl 6)

Straightforward implementation using Raku's *is-prime* built-in subroutine.

```
sub is-pernicious(Int $n --> Bool) {
    is-prime [+] $n.base(2).comb;
}

say (grep &is-pernicious, 0 .. *)[^25];
say grep &is-pernicious, 888_888_877 .. 888_888_888;

```

Output:

```
3 5 6 7 9 10 11 12 13 14 17 18 19 20 21 22 24 25 26 28 31 33 34 35 36
888888877 888888878 888888880 888888883 888888885 888888886
```