g | x | w | all
Bytes Lang Time Link
028Python 3241008T204519Zjdt
00405AB1E241010T144549ZKevin Cr
023JavaScript ES6241008T224008ZArnauld
003Vyxal241008T230652Zemanresu
005Uiua241008T195211Znyxbird

Python 3, 28 bytes

lambda n:bin(n).count('1')+n

Try it online!

Python 3.10, 24 bytes

lambda n:n.bit_count()+n

As suggested by @squareroot12621

05AB1E, 4 bytes

Three different minor alternatives:

Explanation:

b     # Convert the (implicit) input-integer to a binary-string
 S    # Convert it to a list of bits
  O   # Sum those bits
   +  # Add it to the (implicit) input-integer
      # (after which the result is output implicitly)

b     # Convert the (implicit) input-integer to a binary-string
 1ö   # Convert it to base-1, which sums its digits
   +  # Add it to the (implicit) input-integer
      # (after which the result is output implicitly)

b     # Convert the (implicit) input-integer to a binary-string
 Iª   # Convert the binary-string to a list of bits, and append the input-integer
   O  # Sum this list of bits with appended integer together
      # (after which the result is output implicitly)

JavaScript (ES6), 23 bytes

f=n=>n&&f(n^(n&=-n))-~n

Try it online!

Explanation

Recursion seems like the most code-golf-friendly way of doing this in JS. However, counting the set bits and adding n to the total is not the shortest method because we need to either use n before the recursion starts or remember its original value for the final step.

For example:

n=>n+(g=k=>k&&-~g(k&k-1))(n) // 28 bytes
f=(n,k=n)=>n?-~f(n&n-1,k):k  // 27 bytes

Hence the idea of doing both tasks at the same time in the recursion each time a set bit is encountered, as described below.

Commented

f = n =>    // f is a recursive function taking n
n &&        // stop if n = 0
f(          // otherwise, do a recursive call with:
  n ^       //   n without
  (n &= -n) //   its least significant set bit
            //   which is saved in n
            //   (e.g. 6 AND -6 --> 2, 6 XOR 2 --> 4)
)           // end of recursive call
- ~n        // add 1 + the value of the extracted bit

Vyxal, 3 bytes

b∑+

Try it Online!

  + # Add
 ∑  # Sum
b   # Of bits

Uiua, 5 bytes

+/+⊸⋯

Try it!

+ add the /+ sum of the ⋯ bits ⊸ by the input.