unsigned mystery(int x){               
        unsigned i = 0;
    while(x){
            x = x&(x-1);
            i++;
        }
        return i;                                     
}
I'm thinking this returns powers of '2' till the number we have given.
 
     
    