RosettaCodeData/Task/Pernicious-numbers/00-TASK.txt
2023-07-01 13:44:08 -04:00

21 lines
1,020 B
Text

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.
;Example
'''22'''   (which is   '''10110'''   in binary)   has a population count of   '''3''',   which is prime,   and therefore
<br>'''22''' &nbsp; is a pernicious number.
;Task
* display the first &nbsp; '''25''' &nbsp; pernicious numbers &nbsp; (in decimal).
* display all pernicious numbers between &nbsp; '''888,888,877''' &nbsp; and &nbsp; '''888,888,888''' &nbsp; (inclusive).
* display each list of integers on one line &nbsp; (which may or may not include a title).
;See also
* Sequence &nbsp; [[oeis:A052294|A052294 pernicious numbers]] on The On-Line Encyclopedia of Integer Sequences.
* Rosetta Code entry &nbsp; [[Population_count|population count, evil numbers, odious numbers]].
<br><br>