RosettaCodeData/Task/Population-count/Arturo/population-count.arturo
2026-02-01 16:33:20 -08:00

12 lines
355 B
Text

popCount: function [num][
size select split to :string .format:".b" num 'x -> x="1"
]
print "population count for the first thirty powers of 3:"
print map 0..29 => [popCount 3^&]
print "first thirty evil numbers"
print take select 0..100 => [even? popCount &] 30
print "first thirty odious numbers"
print take select 0..100 => [odd? popCount &] 30