2018-06-22 20:57:24 +00:00
A [[wp:Pernicious number|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.
2015-02-20 09:02:09 -05:00
2015-11-18 06:14:39 +00:00
2017-09-23 10:01:46 +02:00
;Example
'''22''' (which is '''10110''' in binary) has a population count of '''3''', which is prime, and therefore '''22''' is a pernicious number.
2016-12-05 22:15:40 +01:00
2017-09-23 10:01:46 +02:00
;Task
2018-06-22 20:57:24 +00:00
* display the first '''25''' pernicious numbers (in decimal).
2017-09-23 10:01:46 +02:00
* 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).
2015-02-20 09:02:09 -05:00
2016-12-05 22:15:40 +01:00
2015-02-20 09:02:09 -05:00
;See also
2015-11-18 06:14:39 +00:00
* Sequence [[oeis:A052294|A052294 pernicious numbers]] on The On-Line Encyclopedia of Integer Sequences.
* Rosetta Code entry [[Population_count|population count, evil numbers, odious numbers]].
2016-12-05 22:15:40 +01:00
<br><br>