Cody

Problem 43019. Iterative sum of digits of 2^n number

Given n, calculate the number 2^n (where n>=0) and iterate until the sum of the digits is a single-digit number.

Example:

 Input  n = 7
 Output sum = 2

because 2^7 = 128, and 1+2+8=11 and 1+1=2.

Solution Stats

47.06% Correct | 52.94% Incorrect
Last solution submitted on May 17, 2018

Problem Comments

Recent Solvers15

Suggested Problems

More from this Author2