logistic_guy
Senior Member
- Joined
- Apr 17, 2024
- Messages
- 1,504
Write a recursive method that returns the number of 1’s in the binary representation of N. Use the fact that this is equal to the number of 1’s in the representation of N/2, plus 1, if N is odd.