as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
write an algorithm to determine the digital root of a number.
user
the algorithm for determining the digital root of a number is as follows:
1. start with the number
2. add each individual digit in the number together
3. if the result is a single-digit number, that is the digital root. otherwise, go back to step 2 and repeat until a single-digit number is reached.
assistant