Number of $1$'s in a binary number I'm working on a function $\zeta(\xi)$ that takes as input an integer $\xi$ (in base $10$) and calculates how many $1$'s  there are in its binary representation. How can I write such function?
Here is a graph of $\zeta(\xi)$, for $0\leq\xi\leq250$, created in Excel:

By now, I have tried only brute-forcing: calculate a lot of values of $\zeta(\xi)$ to try to find a common pattern, but this doesn't seem helpful in finding an explicit formula. Any idea?

For computer applications, there is hardware support for this problem:
Intel CPU Nvidia GPU
Here is an algorithm in C from Brian Kernighan:
uint64_t countBits(uint64_t input){
uint64_t counter;
for(counter=0; input > 0; counter++)
    input &= (input - 1); /*clear the set lsb*/
return counter;
}

