Dsa
Recursion
Warm-up
Integer Half-Life Sum
Calculate the 'half-life sum' of an integer N. This is the sum of N plus the half-life sum of (N // 2), continuing until the value is 0.
Input: A single integer N.
Output: The total sum.
Example:
Input: 10
Output: 18
(Explanation: 10 + 5 + 2 + 1 = 18)
Key concepts
recursionmathseries
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now