Pernicious numbers: Difference between revisions
Content added Content deleted
(Add Plain English) |
Alextretyak (talk | contribs) (Added 11l) |
||
Line 19: | Line 19: | ||
* Rosetta Code entry [[Population_count|population count, evil numbers, odious numbers]]. |
* Rosetta Code entry [[Population_count|population count, evil numbers, odious numbers]]. |
||
<br><br> |
<br><br> |
||
=={{header|11l}}== |
|||
<lang 11l>F popcount(n) |
|||
R bin(n).count(‘1’) |
|||
F is_prime(n) |
|||
I n < 2 |
|||
R 0B |
|||
L(i) 2 .. Int(sqrt(n)) |
|||
I n % i == 0 |
|||
R 0B |
|||
R 1B |
|||
V i = 0 |
|||
V cnt = 0 |
|||
L |
|||
I is_prime(popcount(i)) |
|||
print(i, end' ‘ ’) |
|||
cnt++ |
|||
I cnt == 25 |
|||
L.break |
|||
i++ |
|||
print() |
|||
L(i) 888888877..888888888 |
|||
I is_prime(popcount(i)) |
|||
print(i, end' ‘ ’)</lang> |
|||
{{out}} |
|||
<pre> |
|||
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 |
|||
</pre> |
|||
=={{header|360 Assembly}}== |
=={{header|360 Assembly}}== |