Given a positive integer n, calculate the following sum:
n + n/2 + n/4 + n/8 + ...
All elements of the sum are the results of integer division. Continue dividing the number until you reach a decimal (no decimals allowed in final answer).
25 => 25 + 12 + 6 + 3 + 1 = 47
Want to propose a challenge idea for a future post? Email firstname.lastname@example.org with your suggestions!