Pernicious numbers: Difference between revisions

Content added Content deleted
m (→‎{{header|11l}}: popcount())
Line 22: Line 22:


=={{header|11l}}==
=={{header|11l}}==
<syntaxhighlight lang="11l">F popcount(n)
<syntaxhighlight lang="11l">F is_prime(n)
R bin(n).count(‘1’)

F is_prime(n)
I n < 2
I n < 2
R 0B
R 0B
Line 36: Line 33:
V cnt = 0
V cnt = 0
L
L
I is_prime(popcount(i))
I is_prime(i.popcount())
print(i, end' ‘ ’)
print(i, end' ‘ ’)
cnt++
cnt++
Line 45: Line 42:
print()
print()
L(i) 888888877..888888888
L(i) 888888877..888888888
I is_prime(popcount(i))
I is_prime(i.popcount())
print(i, end' ‘ ’)</syntaxhighlight>
print(i, end' ‘ ’)</syntaxhighlight>