Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Population-count/Arturo/population-count.arturo
Normal file
12
Task/Population-count/Arturo/population-count.arturo
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
popCount: function [num][
|
||||
size select split to :string as.binary 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue