**PROBLEM LINKS:**

Practice

Contest

**DIFFICULTY:**

Easy

**PREREQUISITES:**

None

**PROBLEM:**

Add all the digits of the given number until you get a single digit number.

This problem is also known as the digital root problem.

**EXPLANATION:**

For finding digital root, the following formula exists:

((n-1)%9)+1)

**AUTHOR’S AND TESTER’S SOLUTIONS:**

Author’s solution can be found here.

Tester’s solution can be found here.