The task is to find the shortest solution to the following problem:
Given an integer \$n\$ (\$0<n<10^7\$) find \$n+C(n)\$, where \$C(n)\$ is the count of set bits in the binary representation of \$n\$.
Whitespace must not be included in the final count.
My current solution (78 bytes, C++14):
#include"iostream"
int n;main({std::cin>>n;std::cout<<n+__builtin_popcount(n);}
To clarify: some solutions from here will not work, as they subtract from the original \$n\$, so some methods cannot be reused.
nto its number of set bits is a completely random addition. Without apopcountbuilt-in, there's at least one way of doing this which turns out shorter than just addingnto the result of the other challenge. \$\endgroup\$