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.
I clarified the problem statement and fixed one test case to make the problem solvable as originally intended.
Anyone else running into an issue with 2^111? I'm getting 2^111 = 2596148429267413814265248164610048, which sums to 143, which sums to 8. The test suite says 9.
The last test is not correct. Could you check it ?
Yes, this is a sequence (1 2 4 8 7 5 1 2 4 8 7 5 ...)
Return the largest number that is adjacent to a zero
3109 Solvers
357 Solvers
81 Solvers
Determine the length of a string of characters
121 Solvers
Change the first and last diagonal element of the identity matrix to zero
86 Solvers