Population count
This page is a solution to the task Population count in the Rosetta Code, written in Fōrmulæ.
Contents
Description (from Rosetta Code)
The population count is the number of 1s (ones) in the binary representation of a nonnegative integer.
Population count is also known as pop count, popcount, sideways sum, and Hamming weight.
Evil numbers are nonnegative integers that have an even population count. Odious numbers are positive integers that have an odd population count.

Solution
Fōrmulæ has an integrated expression BitCount that counts the number of 1's of the binary representation of the number.
However, a function can also be written, as follows:
The plot of the population count of the numbers 0..256:
Case 1. Displaying the pop count of the 1^{st} thirty powers of 3 (3^{0}, 3^{1}, 3^{2}, 3^{3}, 3^{4} ∙∙∙ 3^{29})
Case 2. Displaying the 1^{st} thirty evil numbers
We need first a function to calculate the first numbers whose population count satisfies a given condition, passed as a lambda expression:
Calling the previous function with the criteria of being even numbers:
Case 3. Displaying the 1^{st} thirty odious numbers
Calling the previous function with the criteria of being odd numbers: